Add ytdl_format.

This commit is contained in:
tastytea 2020-12-16 16:13:57 +01:00
parent dac055634c
commit b8347e1645
1 changed files with 3 additions and 1 deletions

View File

@ -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
}