summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-31 09:19:46 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-31 09:19:46 +0900
commitd16d8a8bf35d508b036b4672cae77a536573c59b (patch)
tree74dfb5ba09b6dc6582341d36df018e33aeed58a0
parentf61e1892b33ee1abc5eadd2db5fa2b981d79fa03 (diff)
modified bin/qndl
-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"
;;