summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xar/.local/bin/qndl4
1 files changed, 3 insertions, 1 deletions
diff --git a/ar/.local/bin/qndl b/ar/.local/bin/qndl
index c020766..23aa466 100755
--- a/ar/.local/bin/qndl
+++ b/ar/.local/bin/qndl
@@ -79,7 +79,9 @@ case $URL in
YTDL_CMD_BASE="$YTDL_CMD_BASE --yes-playlist" &&
echo 🪏 >/tmp/qplaylist
[ "$DOWNLOAD_TYPE" = "video" ] &&
- SUBDIR=$(yt-dlp --dump-single-json "$URL" --no-playlist | jq -r '.channel' | sed 's/[\/:*?"<>| ]/-/g' | tr '[:upper:]' '[:lower:]') &&
+ CHANNEL=$(yt-dlp --print "%(channel)s" "$URL" | head -n 1 | sed 's/[\/:*?"<>| ]/-/g' | tr '[:upper:]' '[:lower:]') &&
+ PLAYLIST=$(yt-dlp --print "%(playlist_title)s" "$URL" | head -n 1 | sed 's/[\/:*?"<>| ]/-/g' | tr '[:upper:]' '[:lower:]') &&
+ SUBDIR="${CHANNEL}/${PLAYLIST}" &&
mkdir -p "${OUTPUT_DIR}/${SUBDIR}" &&
YTDL_OUTPUT_FORMAT="${OUTPUT_DIR}/${SUBDIR}/%(playlist_index)02d_%(title)s [%(id)s].%(ext)s"
;;