From 10e435b1956ab1c4c365bab598c88207f4ef3a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20M=C3=A4ki?= Date: Mon, 28 Apr 2025 22:17:09 +0300 Subject: [PATCH] Add downloader for YouTube playlist data --- zsh/custom/video.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/zsh/custom/video.zsh b/zsh/custom/video.zsh index 3f45202..0bb83c1 100644 --- a/zsh/custom/video.zsh +++ b/zsh/custom/video.zsh @@ -44,3 +44,16 @@ monitorconf() { ;; esac } + +yt-dlp-playlist() { + if [ $# -ne 1 ]; then + echo "Usage: yt-dlp-playlist " + fi + TITLE="$(yt-dlp --skip-download --print playlist_title --no-warnings "${1}" -I "1:1")" + echo "Downloading playlist data: ${TITLE}" + echo "Downloading data as txt:" + yt-dlp -s --flat-playlist --print-to-file "%(url)s # %(title)s" "%(playlist_title)s.txt" "${1}" + echo "Downloading data as json:" + yt-dlp --dump-single-json --skip-download --no-warnings "${1}" > "${TITLE}.json" + echo "Playlist data downloaded." +}