From b8347e1645a0e2420201e380d87034a66fe3cc24 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 16 Dec 2020 16:13:57 +0100 Subject: [PATCH] Add ytdl_format. --- download-yt-feeds.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/download-yt-feeds.sh b/download-yt-feeds.sh index 03b5ac1..a877752 100755 --- a/download-yt-feeds.sh +++ b/download-yt-feeds.sh @@ -51,13 +51,15 @@ function main() source "${config_path}" [[ -z "${download_dir}" ]] && die 2 "download_dir not specified." [[ -z "${keep_for_days}" ]] && die 2 "keep_for_days not specified." + [[ -z "${ytdl_format}" ]] && local ytdl_format="best" local -a feedlist=("${(@Q)${(z)$(read_feedlist)}}") for feed in ${feedlist}; do youtube-dl \ --download-archive "$(get_config_path)/downloaded" \ --dateafter "now-${keep_for_days}days" \ - --output "${download_dir}/%(title)s.%(ext)s" \ + --output "${download_dir}/%(channel)s/%(title)s.%(ext)s" \ + --format "${ytdl_format}" \ "${feed}" done }