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.
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment