Skip to content

Instantly share code, notes, and snippets.

@donhector
Last active April 19, 2020 20:29
Show Gist options
  • Save donhector/b4e517a0a1fefaf81d63a20549420fec to your computer and use it in GitHub Desktop.
Save donhector/b4e517a0a1fefaf81d63a20549420fec to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
sudo apt update
sudo apt install -y ffmpeg
pip install --user --upgrade youtube_dl
mkdir -p music && cd music
# Resource supports links to youtube videos and playlists
# Command will extract audio, in mp3 format, with best possible quality, embedding metadata and thumbnail,
# keeping track of the downloaded files to avoid redownloads, and saving files as "<title>.mp3"
RESOURCE='https://www.youtube.com/playlist?list=PLi3Dv1AGAEKbhJRxnV7244q1ECVPRCC8n'
youtube-dl -x --audio-format mp3 --embed-thumbnail --add-metadata --download-archive list.txt -o '%(title)s.%(ext)s' ${RESOURCE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment