summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/yt35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/yt b/scripts/yt
new file mode 100755
index 0000000..e5e67ca
--- /dev/null
+++ b/scripts/yt
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+YT_DL_PATH="$HOME/Videos/youtube"
+YT_INDEX="$YT_DL_PATH/youtube.txt"
+
+Usage() {
+ printf "Usage: %s [--download-path path] [--index-file path]\n" $(basename $0) > /dev/stderr
+ exit 1
+}
+
+while [[ $# -gt 0 ]];
+do
+ case $1 in
+ --download-path)
+ shift
+ YT_DL_PATH="$1"
+ YT_INDEX="$YT_DL_PATH/youtube.txt"
+ ;;
+ --index-file)
+ shift
+ YT_INDEX="$1"
+ ;;
+ --help)
+ Usage
+ ;;
+ *)
+ printf "Unknown option: %s\n" $1 > /dev/stderr
+ Usage
+ ;;
+ esac
+ shift
+done
+
+parallel "yt-dlp -o \"$YT_DL_PATH/%(title)s.%(ext)s\" --restrict-filenames" ::: $(cat $YT_INDEX)
+