Skip to content

Instantly share code, notes, and snippets.

@kytta
Last active March 12, 2022 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kytta/6256a922cdb3575a1799f5365552be4e to your computer and use it in GitHub Desktop.
Save kytta/6256a922cdb3575a1799f5365552be4e to your computer and use it in GitHub Desktop.
yt-dlp configuration for optimal music download
# File format: "Artist/Album/# - Track.ext"
-o '%(album_artist)s/%(album)s/%(playlist_index)s - %(title)s.%(ext)s'
--no-mtime
# Get best audio
-f 'ba*'
# Extract audio: MP3, best VBR
-x --audio-format mp3 --audio-quality 0
# Cover art
--embed-thumbnail
# Extract album artist from channel name
--embed-metadata
--parse-metadata '%(album_artist,channel,creator,artist|Unknown)s:%(album_artist)s'
@kytta
Copy link
Author

kytta commented Mar 12, 2022

This gist is for educational purposes! Do not download copyrighted music!

This configuration is for downloading music albums from YouTube Music (or just YouTube). When given a link to an album, it will parse the artist and the name and create a neatly organized file structure out of it. It will choose the best audio available and convert it to MP3 with the best VBR quality (so, you'll need ffmpeg)

After this, you could use beets to auto-tag and import this music to your library. Thanks to the music being pre-sorted, beets has an easier time finding the album information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment