forked from glubsy/livestream_saver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
livestream_saver.cfg.template
254 lines (205 loc) · 8.68 KB
/
livestream_saver.cfg.template
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
[DEFAULT]
# If these keys are not specified in other sections,
# these will be used as a fallback.
# Default log level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
# log_level = DEBUG
# Path to cookies that is commmon to all modes if not overriden by sections (this is a fallback value)
# cookie =
# Enable sending of e-mail notifications:
# email_notifications = True
# Enable removal of source segments once video has been successfully merged
# (This can be set in each individual sections):
# delete_source = True
# If quality of video or audio stream changes during broadcast, ignore this
# change and keep downloading anyway. This may result in errors during the final
# segments merge step.
# ignore_quality_change = False
[common]
# These variables can be re-used in other sections through interpolation.
# This section does nothing else.
# Reference these variables as ${common:variable_name} from anywhere.
# Only trigger download if this regex matches in video title + description
allow_regex = ".*archiv.*|.*karaoke.*"
# Do not trigger download if this regex matches in video title + description
block_regex = ""
# This is just an example invoking yt-dlp (limiting maximum video height to 240p).
# Note that "--cookies %COOKIE_PATH%" will be smartly removed if the value was
# not provided from this config file or as a command line argument.
ytdlp_command = yt-dlp
-v
--embed-thumbnail
--fragment-retries 50
-o '%(upload_date)s %(uploader)s %(title)s_[%(height)s]_%(id)s.%(ext)s'
; -f 'bestvideo+bestaudio'
-S "+res:240,res:360"
--add-metadata
--cookies %COOKIE_PATH%
--live-from-start
--wait-for-video 5
%VIDEO_URL%
# Path to cookies that can be re-used in individual sections:
cookie =
[webhook]
# Convenience section, similar to [common].
# Example of a typical endpoint URL:
webhook_url = https://discord.com/api/webhooks/xxx/yyy
# For more security, this can be overriden from environment variables:
# webhook_url = {env:webhook_url_for_discord}
# Example of a typical payload to send to Discord (note that this key is also
# what will be loaded in test-notification mode as well):
webhook_data = '{
"content": "UPCOMING %ISLIVECONTENT%: (starts @ %START_TIME%, %LIVE_STATUS_SHORT%)",
"embeds": [{
"title": "%TITLE% (%VIDEO_ID%) %ISMEMBERSONLY%",
"url": "%VIDEO_URL%",
"description": "%LIVE_STATUS%\n%DESCRIPTION%\nScheduled @ %LOCAL_SCHEDULED%",
"thumbnail": { "url": "%THUMBNAIL_URL%" },
"author": { "name": "%AUTHOR%" }
}
]}'
webhook_data_live = '{
"content": "%ISLIVECONTENT% just went LIVE:",
"embeds": [{
"title": "%TITLE% (%VIDEO_ID%) %ISMEMBERSONLY%",
"url": "%VIDEO_URL%",
"description": "%DESCRIPTION%",
"thumbnail": { "url": "%THUMBNAIL_URL%" },
"author": { "name": "%AUTHOR%" }
}
]}'
[email]
# Values in this section will be overriden by environment variables
# of the same names (case insensitive).
# smtp_server =
# smtp_port =
# smtp_login =
# smtp_password =
# to_email =
# from_email =
[monitor]
# These values are only loaded in Monitor mode.
log_level = INFO
# Delay between scan retries in minutes
scan_delay = 15.5
# Path to Netscape formatted cookie file.
# cookie = /path/to/cookies.txt
# Only trigger download if this regex matches video title + description.
allow_regex = ''
# Do not trigger download if this regex matches video title + description (not very useful).
block_regex = ""
# This triggers when an upcoming video is listed in the channel page.
on_upcoming_detected_command = ${common:ytdlp_command}
on_upcoming_detected_command_enabled = false
on_upcoming_detected_command_logged = false
# These regexes only apply to the condition on which to spawn the command.
on_upcoming_detected_command_allow_regex =
# For example, do not download KSON's "video" that is used solely as a permanent chat room
on_upcoming_detected_command_block_regex = ".*FREE CHATTING SPACE.*"
# This will trigger a web hook.
on_upcoming_detected_webhook = ${webhook:webhook_data}
on_upcoming_detected_webhook_url = ${webhook:webhook_url}
on_upcoming_detected_webhook_enabled = false
on_upcoming_detected_webhook_logged = true
on_upcoming_detected_webhook_allow_regex =
on_upcoming_detected_webhook_block_regex =
# This should trigger only for non-live videos (VOD).
on_video_detected_command = ${common:ytdlp_command}
on_video_detected_command_enabled = false
on_video_detected_command_logged = true
# These regexes only apply to the condition on which to spawn the command.
on_video_detected_command_allow_regex = ${common:allow_regex}
on_video_detected_command_block_regex =
# This triggers when a download is pending and waiting for a livestream to start.
on_download_initiated_command = ${common:ytdlp_command}
on_download_initiated_command_enabled = false
on_download_initiated_command_logged = true
# These regexes only apply to the condition on which to spawn the command.
# These are matched against both title + description.
on_download_initiated_command_allow_regex = ${monitor:allow_regex}
on_download_initiated_command_block_regex = ${monitor:block_regex}
# This triggers when the download has actually started on an active livestream.
on_download_started_command =
on_download_started_command_enabled = false
on_download_started_command_logged = false
# These regexes only apply to the condition on which to spawn the command.
# These are matched against both title + description.
on_download_started_command_allow_regex = ${common:allow_regex}
on_download_started_command_block_regex = ${common:block_regex}
# This triggers when we consider a livestream to be finished.
on_download_ended_command =
on_download_ended_command_enabled = false
on_download_ended_command_logged = false
# This triggers when the merge is done (successfully or not).
on_merge_done_command =
on_merge_done_command_enabled = false
on_merge_done_command_logged = false
# This can be used in any section to skip downloading anything.
# skip_download = True
[download]
# These values are only loaded in Download mode.
log_level = WARNING
# If live has not started yet, delay retrying by this many minutes.
scan_delay = 2.5
# Path to Netscape formatted cookie file.
# cookie = /path/to/cookies.txt
# This triggers when a download is pending and waiting for a livestream to start.
on_download_initiated_command = ${common:ytdlp_command}
on_download_initiated_command_enabled = false
on_download_initiated_command_logged = false
on_download_initiated_command_allow_regex = ${common:allow_regex}
on_download_initiated_command_block_regex = ${common:block_regex}
# This triggers when the download has actually started on an active livestream.
on_download_started_command =
on_download_started_command_enabled = false
on_download_started_command_logged = false
on_download_started_command_allow_regex = ${common:allow_regex}
on_download_started_command_block_regex = ${common:block_regex}
# This triggers when we consider a livestream to be finished.
on_download_ended_command =
on_download_ended_command_enabled = false
on_download_ended_command_logged = false
# This triggers when the merge is done (successfully or not).
on_merge_done_command =
on_merge_done_command_enabled = false
on_merge_done_command_logged = false
# These values in the following sections only apply to Monitor mode.
[monitor Meru]
channel_name = Matsuro Meru
scan_delay = 20.0
URL = https://www.youtube.com/channel/UCIJ6TGsTcBlYGUj-zbL60EQ
[monitor Prune]
channel_name = Prune
scan_delay = 25.0
URL = https://www.youtube.com/c/Prune73
[monitor Purin]
channel_name = Inukai Purin
scan_delay = 20.0
URL = https://www.youtube.com/channel/UCdrQWcX7XLDSUEh9SAxnyBg
[monitor Kana]
channel_name = Kamiko Kana
scan_delay = 20.0
URL = https://www.youtube.com/c/kamikokana
[monitor Gura]
# These values only apply to monitor mode.
channel_name = Gawr Gura
scan_delay = 20.0
URL = https://www.youtube.com/channel/UCoSrY_IQQVpmIRZ9Xf-y93g
cookie = ${common:cookie}
# Spawn a subprocess of your choosing (only for this target channel, and only
# if the metadata matches the regex):
on_upcoming_detected_command = ${common:ytdlp_command}
on_upcoming_detected_command_enabled = false
on_upcoming_detected_command_logged = true
on_upcoming_detected_command_allow_regex = ".*archiv.*|.*karaoke.*|.*sing.*"
on_upcoming_detected_command_block_regex =
# Trigger a web hook (only for this channel)
on_download_initiated_webhook = ${webhook:webhook_data_live}
on_download_initiated_webhook_url = ${webhook:webhook_url}
on_download_initiated_webhook_enabled = false
on_download_initiated_webhook_logged = true
on_download_initiated_webhook_allow_regex =
on_download_initiated_webhook_block_regex =
# Note that using "" as value will remove any value set in the "monitor" section
# above. This is useful to override the value for a specific channel only.
allow_regex = ".*archiv.*|.*karaoke.*|.*sing.*"
block_regex = ""