summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaa <kaa@disroot.org>2025-07-30 22:46:07 -0700
committerkaa <kaa@disroot.org>2025-07-30 22:46:07 -0700
commit56ae33460ce53dd1e915ed955409727bb2ec7f8c (patch)
treef1c5a37d3955908e0bc938df0765882d124fb7f3
parentc4c2fb20e7c07aacfa176b0e3328574f271abeb3 (diff)
$wrk directory subtleties
-rwxr-xr-xytpoll11
1 files changed, 10 insertions, 1 deletions
diff --git a/ytpoll b/ytpoll
index 4fa1de5..3b08016 100755
--- a/ytpoll
+++ b/ytpoll
@@ -31,7 +31,16 @@ dl()
# 20250729 How I Met Goldilocks rg344jf29.webm
yt-dlp -o "$wrk/%(channel)s/%(upload_date)s %(fulltitle)s %(id)s.%(ext)s" -o "thumbnail:$wrk/%(channel)s/%(upload_date)s %(fulltitle)s %(id)s.%(ext)s" -o "description:$wrk/%(channel)s/%(upload_date)s %(fulltitle)s %(id)s.%(ext)s" --write-sub --write-auto-sub --sub-lang "en.*" --write-thumbnail --write-description --embed-metadata --embed-subs -f $vq+$aq $video
- mv $wrk/* $out
+ for channel in $wrk/*
+ do
+ channel=$(echo $channel | sed -e 's|.*/||')
+ if ! [ -d "$out/$channel" ]
+ then
+ mkdir "$out/$channel"
+ fi
+ mv "$wrk/$channel/"* "$out/$channel"
+ done
+ rmdir "$wrk/$channel"
}
check()