Get YouTube Live m3u8 #3451
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Get YouTube Live m3u8 | |
on: | |
schedule: | |
- cron: "0 */6 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install yt-dlp | |
run: | | |
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp | |
sudo chmod a+rx /usr/local/bin/yt-dlp | |
- name: Get ttvnews.m3u8 | |
run: | | |
touch ./ttvnews.m3u8 | |
sudo cat >./ttvnews.m3u8 <<EOL | |
#EXTM3U | |
#EXT-X-VERSION:3 | |
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=5400000 | |
$(yt-dlp -g https://www.youtube.com/watch?v=xL0ch83RAK8) | |
EOL | |
- name: Get ftvnews.m3u8 | |
run: | | |
touch ./ftvnews.m3u8 | |
sudo cat >./ftvnews.m3u8 <<EOL | |
#EXTM3U | |
#EXT-X-VERSION:3 | |
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=5400000 | |
$(yt-dlp -g https://www.youtube.com/watch?v=ylYJSBUgaMA) | |
EOL | |
- name: Get ctiasia.m3u8 | |
run: | | |
touch ./ctiasia.m3u8 | |
sudo cat >./ctiasia.m3u8 <<EOL | |
#EXTM3U | |
#EXT-X-VERSION:3 | |
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=5400000 | |
$(yt-dlp -g https://www.youtube.com/watch?v=oPx1u9WQrWg) | |
EOL | |
- name: Get ctinews2.m3u8 | |
run: | | |
touch ./ctinews2.m3u8 | |
sudo cat >./ctinews2.m3u8 <<EOL | |
#EXTM3U | |
#EXT-X-VERSION:3 | |
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=5400000 | |
$(yt-dlp -g https://www.youtube.com/watch?v=WPfPjbOLNfE) | |
EOL | |
- name: Get ctinews.m3u8 | |
run: | | |
touch ./ctianews.m3u8 | |
sudo cat >./ctianews.m3u8 <<EOL | |
#EXTM3U | |
#EXT-X-VERSION:3 | |
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=5400000 | |
$(yt-dlp -g https://www.youtube.com/watch?v=_QbRXRnHMVY) | |
EOL | |
- name : Upload artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: ytblive m3u8 | |
path: . | |
- name: Git push assets to "ytblive" branch | |
run: | | |
git init | |
git config --local user.name "humphreygao" | |
git config --local user.email "1520080049@qq.com" | |
git checkout -b ytblive | |
git add . | |
git commit -m "Update ytblive" | |
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" | |
git push -f -u origin ytblive |