From 897f88aea69093b3ade4c7444d69af754f88f50d Mon Sep 17 00:00:00 2001 From: emma Date: Tue, 21 Nov 2023 12:46:31 -0700 Subject: [PATCH] made cloning resolve the playlist name automatically --- yt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"