forked from ame-yu/u2bili
-
Notifications
You must be signed in to change notification settings - Fork 0
/
youtube.yml
47 lines (47 loc) · 2.33 KB
/
youtube.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
on:
youtube:
channel_id:
- UCwXdFgeE9KYzlDdR7TG9cMw #Flutter
- UCsBjURrPoezykLs9EqgamOA #Fireship
- UCP7uiEZIqci43m22KDl0sNw #Kotlin by JetBrains
# 找不到UC开头的ID? channel主页 ctrl+u ctrl+f 搜channel_id=
playlist_id:
- PL0lo9MOBetEFCNnxB1uZcDGcrPO1Jbpz8 #GitHub Changelog
config:
filterScript: |
return new Date() - 24 * 3600 * 1000 < new Date(item.pubDate) //Recent 24 hours Only
jobs:
print:
name: U2bili workflow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup headless environment
run: |
node -v
corepack enable
apt-get update >> apt.log
apt-get install -y wget ffmpeg python3 >> apt.log
pnpm i
npx -qy playwright install firefox
# Install Chromium dependency
apt-get install -y 'fonts-liberation' 'libasound2' 'libatk-bridge2.0-0' 'libatk1.0-0' 'libatspi2.0-0' 'libcairo2' 'libcups2' 'libdbus-1-3' 'libdrm2' 'libgbm1' 'libgdk-pixbuf2.0-0' 'libglib2.0-0' 'libgtk-3-0' 'libnspr4' 'libnss3' 'libpango-1.0-0' 'libpangocairo-1.0-0' 'libx11-6' 'libx11-xcb1' 'libxcb-dri3-0' 'libxcb1' 'libxcomposite1' 'libxdamage1' 'libxext6' 'libxfixes3' 'libxi6' 'libxrandr2' 'libxtst6' >> apt.log
# Install FireFox dependency
apt-get install -y 'libatk1.0-0' 'libcairo-gobject2' 'libcairo2' 'libdbus-1-3' 'libdbus-glib-1-2' 'libfontconfig1' 'libfreetype6' 'libglib2.0-0' 'libgtk-3-0' 'libgtk2.0-0' 'libharfbuzz0b' 'libpango-1.0-0' 'libpangocairo-1.0-0' 'libpangoft2-1.0-0' 'libx11-6' 'libx11-xcb1' 'libxcb-shm0' 'libxcb1' 'libxcomposite1' 'libxcursor1' 'libxdamage1' 'libxext6' 'libxfixes3' 'libxi6' 'libxrender1' 'libxt6' >> apt.log
# Install latest yt-dlp
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
chmod a+rx /usr/local/bin/yt-dlp
- name: u2bili
timeout-minutes: 30 # Set timeout 30min
env:
link: ${{on.youtube.outputs.link}}
BILIBILI_COOKIE: ${{ secrets.BILIBILI_COOKIE }}
run: |
chmod +x ./u2bili.sh && ./u2bili.sh "${link}"
# - name: upload Fail video if failure
# uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: video record
# path: |
# videos/