Skip to content

Instantly share code, notes, and snippets.

@chriskempson
Last active February 12, 2020 22:14
Show Gist options
  • Save chriskempson/fe9efcbe1c2014c569fb92de57f44d2f to your computer and use it in GitHub Desktop.
Save chriskempson/fe9efcbe1c2014c569fb92de57f44d2f to your computer and use it in GitHub Desktop.
Download audio files from a YouTube playlist
#!/bin/sh
# Downloads a YouTube playlist and coverts it to 320kbps MP3 with
# embedded thumnails, metadata and proper track naming.
#
# Example usage:
#
# ./youtube-dl-playlist-audio.sh https://www.youtube.com/playlist?list=PLFgquLnL59alxIWnf4ivu5bjPeHSlsUe9
#
# MP3 320 kbps
# youtube-dl -f bestaudio --extract-audio --audio-format mp3 --audio-quality 320k --embed-thumbnail --add-metadata -o '%(playlist_index)s. %(title)s.%(ext)s' --no-post-overwrites --geo-bypass --ignore-errors $1
# OPUS 160 kbps (passthrough)
youtube-dl -f bestaudio --extract-audio --audio-format opus --audio-quality 160k --add-metadata -o '%(playlist_index)s. %(title)s.%(ext)s' --no-post-overwrites --geo-bypass --ignore-errors $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment