made cloning resolve the playlist name automatically
This commit is contained in:
parent
76b633cbdb
commit
897f88aea6
5
yt
5
yt
@ -19,6 +19,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
test -z "$DEBUG" || set -x
|
test -z "$DEBUG" || set -x
|
||||||
|
|
||||||
test -z "$XDG_CACHE_HOME" && cachefile="$HOME/.cache/yt.cache" \
|
test -z "$XDG_CACHE_HOME" && cachefile="$HOME/.cache/yt.cache" \
|
||||||
|| cachefile="$XDG_CACHE_HOME/yt.cache"
|
|| cachefile="$XDG_CACHE_HOME/yt.cache"
|
||||||
|
|
||||||
@ -88,7 +89,9 @@ cache() { # cache the video title for faster retrieval
|
|||||||
|
|
||||||
clone() { # clones a YouTube playlist to a file
|
clone() { # clones a YouTube playlist to a file
|
||||||
test -d "$YT_PL_DIR" || mkdir -p "$YT_PL_DIR"
|
test -d "$YT_PL_DIR" || mkdir -p "$YT_PL_DIR"
|
||||||
file="$YT_PL_DIR/$2.m3u"
|
|
||||||
|
if test -n "$2" && file="$2" \
|
||||||
|
|| file="$YT_PL_DIR/$('%(playlist)s' "$1").m3u"
|
||||||
|
|
||||||
yt-dlp --flat-playlist "$1" --print url > "$file"
|
yt-dlp --flat-playlist "$1" --print url > "$file"
|
||||||
verify "$file"
|
verify "$file"
|
||||||
|
Loading…
Reference in New Issue
Block a user