aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/config.ts1
-rw-r--r--scripts/ytdlp_flatten.md1
-rw-r--r--scripts/ytdlp_flatten.ts6
3 files changed, 6 insertions, 2 deletions
diff --git a/scripts/config.ts b/scripts/config.ts
index ca8ef1c..5b5f1da 100644
--- a/scripts/config.ts
+++ b/scripts/config.ts
@@ -3,6 +3,7 @@ export interface Config {
enqueue: EnqueueTask[]
ytdlp_flatten: {
filters: { [key: string]: string }
+ enqueue_info?: boolean
}
ytdlp_download: {
output: string,
diff --git a/scripts/ytdlp_flatten.md b/scripts/ytdlp_flatten.md
index 97ffb39..dd7be2b 100644
--- a/scripts/ytdlp_flatten.md
+++ b/scripts/ytdlp_flatten.md
@@ -11,6 +11,7 @@ Where task ids are the ids assigned by the respective platform.
- `filters`: Map from flag to filter. Flags are taken from the `flag`
attribute in task data. Filters are passed straight to yt-dlp's
`--match-filter` flag.
+ - `enqueue_info`: Enqueues the correspoding channel info task on completion.
Sample configuration:
diff --git a/scripts/ytdlp_flatten.ts b/scripts/ytdlp_flatten.ts
index 5145196..499233d 100644
--- a/scripts/ytdlp_flatten.ts
+++ b/scripts/ytdlp_flatten.ts
@@ -74,8 +74,10 @@ ws.onmessage = async ev => {
if (p.t == "work") {
const [outkind, url] = key_to_url(p.key)
await flat_playlist(url, outkind, p.data)
- ws.send(JSON.stringify({ t: "metadata", key: key_to_infokey(p.key), data: p.data }))
- ws.send(JSON.stringify({ t: "enqueue", key: key_to_infokey(p.key) }))
+ if (config.ytdlp_flatten.enqueue_info) {
+ ws.send(JSON.stringify({ t: "metadata", key: key_to_infokey(p.key), data: p.data }))
+ ws.send(JSON.stringify({ t: "enqueue", key: key_to_infokey(p.key) }))
+ }
ws.send(JSON.stringify({ t: "complete", key: p.key }))
ws.send(JSON.stringify({ t: "save" }))
ws.send(JSON.stringify({ t: "accept" }))