Skip to content

Instantly share code, notes, and snippets.

@eyecatchup
Created August 27, 2024 10:42
Show Gist options
  • Save eyecatchup/79ee6845772171d73d3fbda3fe44148c to your computer and use it in GitHub Desktop.
Save eyecatchup/79ee6845772171d73d3fbda3fe44148c to your computer and use it in GitHub Desktop.

Revisions

  1. eyecatchup created this gist Aug 27, 2024.
    12 changes: 12 additions & 0 deletions yt-dlp-playlist.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/usr/bin/env sh

    # Downloads the audio of all videos of the given playlist,
    # saves as mp3 /with metadata and square(!) thumbnail.
    # Note: yt-dlp and ffmpeg are required.
    # Use: ./yt-dlp-playlist.sh YT_PLAYLIST_ID

    ./yt-dlp --extract-audio --audio-format mp3 --audio-quality 0 \
    --add-metadata --embed-thumbnail --convert-thumbnails jpg \
    --ppa 'EmbedThumbnail+ffmpeg_o:-c:v mjpeg -vf crop="'"'"'if(gt(ih,iw),iw,ih)'"':'"'if(gt(iw,ih),ih,iw)'"'"'"' \
    -o "./%(playlist_index)s - %(title)s.%(ext)s" \
    https://www.youtube.com/playlist?list=$1