scripts: Add custom ytdl options for vidl
Allow setting custom ytdl options for the vidl video downloader. Can be set through $YT_DL_OPTS environment option.
This commit is contained in:
parent
4d563be7a4
commit
60ae405790
1 changed files with 3 additions and 3 deletions
|
@ -5,6 +5,8 @@
|
||||||
DL_FOLDER="${DL_FOLDER:-${XDG_VIDEOS_DIR:-$HOME/videos}}/inbox"
|
DL_FOLDER="${DL_FOLDER:-${XDG_VIDEOS_DIR:-$HOME/videos}}/inbox"
|
||||||
ARCHIVE_FOLDER="${ARCHIVE_FOLDER:-${XDG_VIDEOS_DIR:-$HOME/videos}}/archive"
|
ARCHIVE_FOLDER="${ARCHIVE_FOLDER:-${XDG_VIDEOS_DIR:-$HOME/videos}}/archive"
|
||||||
YT_DL_CMD="${YT_DL_CMD:-yt-dlp}"
|
YT_DL_CMD="${YT_DL_CMD:-yt-dlp}"
|
||||||
|
yt_default_opts=(-f "best[height\<=1080]" --retries 15 --embed-subs --sub-lang "en,de,es,fr")
|
||||||
|
declare -a YT_DL_OPTS=${YT_DL_OPTS:-( "${yt_default_opts[@]}" )}
|
||||||
YT_DL_TITLE="""${YT_DL_TITLE:-%(channel)s_%(title)s_%(id)s}"""
|
YT_DL_TITLE="""${YT_DL_TITLE:-%(channel)s_%(title)s_%(id)s}"""
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
|
@ -71,10 +73,8 @@ _findfile() {
|
||||||
YT_DL_TITLE="%(channel)s_%(title)s_%(id)s"
|
YT_DL_TITLE="%(channel)s_%(title)s_%(id)s"
|
||||||
_download() {
|
_download() {
|
||||||
"$YT_DL_CMD" \
|
"$YT_DL_CMD" \
|
||||||
-f 'best[height<=1080]' \
|
|
||||||
-o "$DL_FOLDER/$YT_DL_TITLE.%(ext)s" \
|
-o "$DL_FOLDER/$YT_DL_TITLE.%(ext)s" \
|
||||||
--write-sub --write-auto-sub --embed-subs --sub-lang en,de,es,fr \
|
"${YT_DL_OPTS[@]}" \
|
||||||
--retries 15 \
|
|
||||||
"$url"
|
"$url"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue