From cd6ce2d4ffa92298d320703810fdd102fdb04ce6 Mon Sep 17 00:00:00 2001 From: Dym Sohin Date: Sat, 14 Oct 2023 21:11:38 +0200 Subject: [PATCH] support for downloading youtube/@user urls --- y.sh | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/y.sh b/y.sh index 09735f3..c80489c 100755 --- a/y.sh +++ b/y.sh @@ -128,23 +128,34 @@ case "$SITE" in 'm.youtube.com'| \ 'youtu.be') echo '> youtube' - case "$OPT" in - 'm') - echo '> > music' + if [[ "$URL" = *youtube\.com\/@* ]]; then + echo '> > store archive' YDL "$URL" -f 251 \ - -o "$MUSIC_PATH/%(title).100B [%(id)s].%(ext)s" + -o "$YT_PATH/%(uploader_id)s/%(title).100B [%(id)s].%(ext)s" + else + case "$OPT" in + 'm') + echo '> > music' + YDL "$URL" -f 251 \ + -o "$MUSIC_PATH/%(title).100B [%(id)s].%(ext)s" + ;; + 'a') + echo '> > audio' + YDL "$URL" -f 251 \ + -o "$AUDIO_PATH/%(title).100B [%(id)s].%(ext)s" + ;; + 's') + echo '> > store archive' + YDL "$URL" -f 251 \ + -o "$YT_PATH/%(uploader_id)s/%(title).100B [%(id)s].%(ext)s" ;; - 'a') - echo '> > audio' - YDL "$URL" -f 251 \ - -o "$AUDIO_PATH/%(title).100B [%(id)s].%(ext)s" - ;; - *) - echo '> > _video_' - YDL "$URL" \ - -o "$DEFAULT_PATH/yt-%(title).100B [%(id)s].%(ext)s" - ;; - esac + *) + echo '> > _video_' + YDL "$URL" \ + -o "$DEFAULT_PATH/yt-%(title).100B [%(id)s].%(ext)s" + ;; + esac + fi ;;