Skip to content

asmrslive

asmrslive #49

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: asmrslive
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
# schedule:
# - cron: '0 3 * * *'
# watch:
# types: [started]
workflow_dispatch:
inputs:
asmr_url:
description: 'asmrs live url'
required: true
default: 'https://asmrs.live/share/62f80771a63000c905b4e65e'
download:
description: 'download yes or no'
required: true
default: 'no'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
if: github.repository_owner == github.actor
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: prepare ffmpeg
if: github.event.inputs.download == 'yes'
run: |
sudo apt-get install -y gpg-agent wget
wget -qO - https://repositories.intel.com/graphics/intel-graphics.key |
sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu focal main' | \
sudo tee -a /etc/apt/sources.list.d/intel.list
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: run
id: m3u8
shell: bash
env:
ASMR_URL: ${{ github.event.inputs.asmr_url }}
DOWNLOAD: ${{ github.event.inputs.download }}
run: |
mkdir -p /opt/catvod/data
cd /opt/catvod/
mkdir output
wget https://github.com/10bits/github-actions-test/releases/download/catvod-JSRE/catvod-linux-x64
chmod +x ./catvod-linux-x64
cp $GITHUB_WORKSPACE/asmrlive.js /opt/catvod/data/
./catvod-linux-x64 <<EOF
loadScript("asmrlive.js")
EOF
- name: download m3u8
if: github.event.inputs.download == 'yes'
shell: bash
env:
url: ${{steps.m3u8.outputs.m3u8_url}}
output: ${{env.UPLOAD_NAME}}
run: |
ffmpeg -i "$url" "/opt/catvod/output/$output.mp3"
- name: upload artifact
uses: actions/upload-artifact@v2
if: success()
with:
name: ${{env.UPLOAD_NAME}}
path: /opt/catvod/output