From 9d9f5d34f816f6b32d5b6829e4c81f27e721f420 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 14 Nov 2023 15:06:59 -0500 Subject: [PATCH] channelArchive.sh dot-source it, then for example, ytdlp '/mnt/gusion/adam/videos/Preserve-evergreen/Rhystic Studies/' 'Rhystic Studies' https://www.youtube.com/@RhysticStudies/videos 0 --- bash/channelArchive.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bash/channelArchive.sh diff --git a/bash/channelArchive.sh b/bash/channelArchive.sh new file mode 100755 index 0000000..24adbb4 --- /dev/null +++ b/bash/channelArchive.sh @@ -0,0 +1,22 @@ + #!/bin/bash + +. /etc/profile +. ~/.bashrc + +function ytdlp(){ + sponsorblock="" + if [ $4 -eq 1 ] + then + sponsorblock="--no-sponsorblock" + fi + pushd "$1" + + yt-dlp --output "%(upload_date)s - %(title)s - [%(id)s].%(ext)s" \ + --format "[ext=mp4]+ba/best" \ + --download-archive "done.txt" \ + --min-sleep-interval 0 --max-sleep-interval 10 \ + $sponsorblock \ + --exec "vidpath=\$(basename {}); vidpath=\$(echo \$vidpath | sed 's/^[0-9]\{8\} - //' | sed 's/- \[[a-zA-Z0-9]\+\]\.mp4//'); textmsg=\"archived video from $2: \$vidpath\"; /home/adam/bin/miscChat.sh \"\$textmsg\";" \ + $3 + popd +}