Skip to content

jschof1/youtune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽต youtune

The smartest YouTube โ†’ MP3 downloader

PyPI Python Tests License: MIT Stars

Auto-tags with MusicBrainz ยท Embeds album art ยท Fetches lyrics ยท Upgrades quality via Soulseek ยท Normalizes loudness ยท Smart renaming


One command. Perfect MP3.

pip install youtune
youtune "https://youtube.com/watch?v=dQw4w9WgXcQ"
  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
  โ”‚  youtune v1.0.0                  โ”‚
  โ”‚  The smartest YouTube โ†’ MP3 downloader โ”‚
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

  ๐ŸŽต Rick Astley โ€” Never Gonna Give You Up (confidence: 90%)
  โœ… Metadata found via MusicBrainz
     ๐Ÿ“€ Album: Whenever You Need Somebody
     ๐Ÿ“… Year:  1987
     #๏ธโƒฃ  Track: 1
  ๐Ÿ“ Lyrics found (36 lines)
  ๐Ÿ–ผ๏ธ  Cover art embedded
  ๐Ÿ“ Renamed โ†’ Rick Astley - Never Gonna Give You Up.mp3

  โœจ Done!

The problem

yt-dlp -x --audio-format mp3 "https://youtube.com/watch?v=..." gives you:

  • โŒ Filename: Rick Astley - Never Gonna Give You Up (Official Music Video) [HD Remaster].mp3
  • โŒ No artist, album, year, or track number
  • โŒ No album art
  • โŒ No lyrics
  • โŒ 128kbps YouTube audio, no loudness normalization
  • โŒ Messy filenames with junk like "(Official Video)", "[HD]", etc.

youtune fixes all of that โ€” automatically.

Features

Feature What it does
๐Ÿง  Smart title parsing Strips "Official Music Video [HD Remaster]" โ†’ extracts clean artist + song
๐Ÿท๏ธ MusicBrainz tagging Looks up the real recording โ†’ writes ID3v2 tags (artist, album, year, track #, genre)
๐Ÿ–ผ๏ธ Album art Fetches cover from Cover Art Archive โ†’ embeds in MP3
๐Ÿ“ Lyrics Fetches synced/plaintext lyrics from lrclib โ†’ embeds in file
๐Ÿ”ฅ Soulseek upgrade Searches Soulseek for FLAC/320kbps โ†’ replaces YouTube download
๐Ÿ”Š Loudness normalization EBU R128 normalization โ€” no more quiet/blasting tracks
๐Ÿ“‚ Playlists Download + tag entire playlists in one shot
โœ๏ธ Smart renaming Rick Astley - Never Gonna Give You Up.mp3 not vevo_aU_official(1).mp3
๐Ÿ”Ž Dry-run search youtune search "Artist - Song" โ†’ preview metadata without downloading
๐ŸŒ Thousands of sites Works with any site yt-dlp supports โ€” not just YouTube

Install

pip install youtune

Prerequisites: yt-dlp and ffmpeg must be on your PATH:

# macOS
brew install yt-dlp ffmpeg

# Ubuntu / Debian
sudo apt install ffmpeg && pip install yt-dlp

# Windows (winget)
winget install yt-dlp.yt-dlp Gyan.FFmpeg

# Arch
sudo pacman -S yt-dlp ffmpeg

Optional: Soulseek support

pip install youtune[soulseek]

Usage

Download & auto-tag a track

youtune "https://youtube.com/watch?v=dQw4w9WgXcQ"

Download with lyrics + loudness normalization

youtune "https://youtube.com/watch?v=..." --lyrics --normalize

Download a playlist

youtune "https://youtube.com/playlist?list=PL..." -o ~/Music/Playlist

Upgrade quality via Soulseek

youtune "https://youtube.com/watch?v=..." \
  --soulseek \
  --soulseek-user myusername \
  --soulseek-pass mypassword

Downloads from YouTube first, then searches Soulseek for FLAC or 320kbps. If found, replaces the YouTube file.

Preview metadata (no download)

youtune search "Radiohead - Everything In Its Right Place"

Skip everything, just download

youtune "https://youtube.com/watch?v=..." --no-tag --no-art --no-rename

How it works

  YouTube URL
      โ”‚
      โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  yt-dlp    โ”‚  Extract audio โ†’ MP3
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Parse      โ”‚  "Rick Astley - Never Gonna Give You Up (Official Video) [HD]"
  โ”‚  title      โ”‚  โ†’ artist: "Rick Astley", song: "Never Gonna Give You Up"
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ MusicBrainz โ”‚  Lookup recording โ†’ album, year, track #, MBIDs
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ Cover Art   โ”‚  Fetch from Cover Art Archive โ†’ embed in MP3
  โ”‚ Archive     โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  lrclib     โ”‚  Fetch synced lyrics โ†’ embed in MP3
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  mutagen    โ”‚  Write ID3v2 tags + APIC art + USLT lyrics
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Soulseek   โ”‚  (optional) Search for FLAC/320 โ†’ replace YouTube file
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  Artist - Title.mp3 โœจ
  (clean, tagged, art, lyrics)

All options

usage: youtune download [-h] [-o OUTPUT] [-q QUALITY] [--normalize] [--lyrics]
                        [--no-tag] [--no-art] [--no-rename] [--soulseek]
                        [--soulseek-user USER] [--soulseek-pass PASS]
                        [--prefer-flac] [--min-bitrate N] [--keep-youtube]
                        URL

  -o, --output         Output directory (default: .)
  -q, --quality        Audio quality 0 (best) โ€“ 9 (worst)
  --normalize          Apply EBU R128 loudness normalization
  --lyrics             Fetch & embed lyrics
  --no-tag             Skip MusicBrainz tagging
  --no-art             Skip cover art
  --no-rename          Keep original filename

  --soulseek           Search Soulseek for better quality
  --soulseek-user      Soulseek username
  --soulseek-pass      Soulseek password
  --prefer-flac        Prefer FLAC from Soulseek (default: true)
  --min-bitrate        Minimum Soulseek bitrate (default: 256)
  --keep-youtube       Keep YouTube file when Soulseek upgrades

FAQ

Does it work with Spotify / SoundCloud / Bandcamp?

Yes! youtune works with any URL that yt-dlp supports โ€” that's thousands of sites.

What if MusicBrainz doesn't have the track?

youtune falls back to the parsed YouTube title. You'll still get a clean filename and basic ID3 tags from whatever was parsed.

What's the Soulseek upgrade?

YouTube audio is typically 128kbps AAC. Soulseek is a P2P network where people share FLAC and 320kbps MP3s. If you enable --soulseek, youtune will search for and download a higher-quality version to replace the YouTube rip. Requires a free Soulseek account.

Can I use it in scripts / CI?

Yes โ€” exit code 0 on success, non-zero on failure. Use -v for debug logging. No interactive prompts.

Why not just use beets?

beets is great for library management, but it's a heavy setup. youtune is zero-config โ€” one command and you're done. You can pipe youtune output into beets if you want both.

Contributing

Contributions welcome! See CONTRIBUTING.md.

Related projects

  • yt-dlp โ€” the download engine that makes this possible
  • MusicBrainz โ€” open music encyclopedia
  • Cover Art Archive โ€” free cover art API
  • lrclib โ€” open-source lyrics database
  • mutagen โ€” Python audio metadata library
  • beets โ€” the music organizer for obsessives
  • slsk-batchdl โ€” Soulseek batch downloader

License

MIT

About

๐ŸŽต The smartest YouTube โ†’ MP3 downloader. Auto-tags with MusicBrainz, embeds album art, fetches lyrics, upgrades quality via Soulseek.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Languages