-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (145 loc) · 5.64 KB
/
youtube-archive.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
name: YouTube Archive
on:
schedule:
- cron: "0 2 * * 2"
workflow_dispatch:
permissions: read-all
jobs:
archive:
runs-on: ubuntu-latest
steps:
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:github-actions
version: 1.72.1
args: --ssh
- name: Install yt-dlp
run: ssh -o StrictHostKeyChecking=no root@production 'sudo apt-get update && sudo apt-get install -y yt-dlp'
- name: Download AND playlist with yt-dlp
run: |
ssh -o StrictHostKeyChecking=no root@production 'yt-dlp \
-o "${{ secrets.SERMON_ARCHIVE_PATH }}/%(playlist_title)s/%(upload_date)s - %(title)s/%(upload_date)s - %(title)s.%(ext)s.%(ext)s" \
--download-archive "${{ secrets.SERMON_ARCHIVE_PATH }}/archive.txt" \
--write-info-json \
--merge-output-format mp4 \
--write-thumbnail \
--write-auto-sub \
--windows-filenames \
--retries 100 \
--file-access-retries 50 \
--no-clean-info-json \
--print after_video:" - %(title)s" \
"https://www.youtube.com/playlist?list=PLbQ39sgTWJxeVK3iDlN10wl_REBksOL6n"'
echo "$out"
continue-on-error: true
id: and_status
- name: Download SW playlist with yt-dlp
run: |
ssh -o StrictHostKeyChecking=no root@production 'yt-dlp \
-o "${{ secrets.SERMON_ARCHIVE_PATH }}/%(playlist_title)s/%(upload_date)s - %(title)s/%(upload_date)s - %(title)s.%(ext)s.%(ext)s" \
--download-archive "${{ secrets.SERMON_ARCHIVE_PATH }}/archive.txt" \
--write-info-json \
--merge-output-format mp4 \
--write-thumbnail \
--write-auto-sub \
--windows-filenames \
--retries 100 \
--file-access-retries 50 \
--no-clean-info-json \
--print after_video:" - %(title)s" \
"https://www.youtube.com/playlist?list=PLbQ39sgTWJxdLdfeabiqL4aMmj1qmZQhv"'
continue-on-error: true
id: sw_status
- name: Download CRK playlist with yt-dlp
run: |
ssh -o StrictHostKeyChecking=no root@production 'yt-dlp \
-o "${{ secrets.SERMON_ARCHIVE_PATH }}/%(playlist_title)s/%(upload_date)s - %(title)s/%(upload_date)s - %(title)s.%(ext)s.%(ext)s" \
--download-archive "${{ secrets.SERMON_ARCHIVE_PATH }}/archive.txt" \
--write-info-json \
--merge-output-format mp4 \
--write-thumbnail \
--write-auto-sub \
--windows-filenames \
--retries 100 \
--file-access-retries 50 \
--no-clean-info-json \
--print after_video:" - %(title)s" \
"https://www.youtube.com/playlist?list=PLbQ39sgTWJxedpjpydtd0R5TV2Wr-XQj3"'
continue-on-error: true
id: crk_status
- name: Download MT playlist with yt-dlp
run: |
ssh -o StrictHostKeyChecking=no root@production 'yt-dlp \
-o "${{ secrets.SERMON_ARCHIVE_PATH }}/%(playlist_title)s/%(upload_date)s - %(title)s/%(upload_date)s - %(title)s.%(ext)s.%(ext)s" \
--download-archive "${{ secrets.SERMON_ARCHIVE_PATH }}/archive.txt" \
--write-info-json \
--merge-output-format mp4 \
--write-thumbnail \
--write-auto-sub \
--windows-filenames \
--retries 100 \
--file-access-retries 50 \
--no-clean-info-json \
--print after_video:" - %(title)s" \
"https://www.youtube.com/playlist?list=PLbQ39sgTWJxcn2eaMMyS3w81u62JwYkTD"'
continue-on-error: true
id: mt_status
- name: Send status to Google Chat
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"cardsV2": [{
"cardId": "ticket",
"card": {
"header": {
"title": "🤖 Y️outube Archive Bot",
"subtitle": "Run completed"
},
"sections": [
{
"header": "️🟡 AND 🟡 ${{ steps.and_status.outcome }}",
"widgets": [
{
"textParagraph": {
"text": "test ${{ steps.and_status.outputs.out }}"
}
}
]
},
{
"header": "️🟢 SW 🟢 ${{ steps.sw_status.outcome }}",
"widgets": [
{
"textParagraph": {
"text": "${{ steps.sw_status.outputs.stdout }}"
}
}
]
},
{
"header": "️🔵 CRK 🔵 ${{ steps.crk_status.outcome }}",
"widgets": [
{
"textParagraph": {
"text": "${{ steps.crk_status.outputs.stdout }}"
}
}
]
},
{
"header": "️🔴 MT 🔴 ${{ steps.mt_status.outcome }}",
"widgets": [
{
"textParagraph": {
"text": "${{ steps.mt_status.outputs.stdout }}"
}
}
]
}
]
}
}]
}' '${{ secrets.GOOGLE_CHAT_WEBHOOK_YT }}'