diff --git a/yt b/yt index 7bed33a..4ebd60a 100755 --- a/yt +++ b/yt @@ -19,6 +19,7 @@ set -e test -z "$DEBUG" || set -x + test -z "$XDG_CACHE_HOME" && cachefile="$HOME/.cache/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 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" verify "$file"