diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2025-08-31 21:46:11 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2025-08-31 21:46:11 -0400 |
| commit | bb4010e31c79d2716098843f7fe9b38c969f0950 (patch) | |
| tree | 10ed7f8f1fbfda3f6d0d6d9f528911a1416fcc74 /scripts/yt | |
| parent | b0eb9b97fe9466d92927a5e746054921e44eaa0c (diff) | |
newsboat adds youtube urls to a file for downloading
Diffstat (limited to 'scripts/yt')
| -rwxr-xr-x | scripts/yt | 35 |
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) + |
