Multi-platform DJ music downloader for YouTube, Spotify, and Apple Music. Downloads tracks and playlists at maximum Rekordbox-compatible quality (AAC M4A) with full metadata, BPM/key analysis, and automatic Rekordbox XML export.
- YouTube — Download single tracks or playlists
- Spotify — Extract metadata via API or embed fallback, match audio on YouTube
- Apple Music — Direct AAC 256kbps download with subscription auth
- Flat output — All files land directly in your configured folder
- Metadata embedding — Title, artist, album, artwork, genre via mutagen
- BPM & Key analysis — Automatic analysis with librosa, writes TBPM/TKEY tags
- Rekordbox XML export — Auto-generates XML for direct Rekordbox import
You need these installed before running the installer:
1. Python 3.12+
# macOS (usually pre-installed, or install via Homebrew)
brew install python
# Check version
python3 --version2. uv (Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh3. ffmpeg (audio conversion)
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt-get install ffmpeg4. deno (optional — for best YouTube audio quality)
# macOS
brew install denoDeno enables yt-dlp to decode YouTube's highest quality audio streams. Without it, downloads still work but may use lower quality fallback formats.
curl -sL https://raw.githubusercontent.com/ftcister/djdl/main/install.sh | bashWhat it installs:
- Clones repo to
~/.djdl/ - Installs
djdlviauv tool install(isolated environment, no global pollution) - Installs Deno (if missing) for best YouTube audio quality
- Ensures
~/.local/binis on your PATH
Then restart your terminal or run source ~/.zshrc.
curl -sL https://raw.githubusercontent.com/ftcister/djdl/main/install.sh | bashRestart your terminal or run source ~/.zshrc.
# Tell djdl where to save your music
djdl set-folder ~/Music/DJ
# Authenticate Apple Music (only if you want Apple Music downloads)
djdl authApple Music auth shows step-by-step instructions to copy your media-user-token cookie from the browser. Paste it and done. The token expires: when a download stops with Apple Music rejected the saved token, run djdl auth again.
Paste any URL:
# YouTube
djdl https://www.youtube.com/watch?v=xxx
# Spotify (finds audio on YouTube, embeds Spotify metadata)
djdl https://open.spotify.com/track/xxx
# Apple Music (requires subscription + auth)
djdl https://music.apple.com/cl/song/xxx
# YouTube playlist
djdl https://youtube.com/playlist?list=xxxWhat happens:
- Downloads AAC M4A at best available quality
- Embeds metadata (title, artist, album, artwork, genre)
- Analyzes BPM and key automatically
- Generates
DJ.xmlin your download folder for Rekordbox import - All files land flat in your configured folder (no subfolders)
open ~/Music/DJYou will see:
Bass Rider - Sidney Charles.m4a
Knock2 - dashstar* (VIP).m4a
DJ.xml ← import this into Rekordbox
djdl update # Pull latest changes and upgradedjdl analyze # Analyze BPM/key for all tracks in folder
djdl --help # Show all available commands| Platform | Required | Command |
|---|---|---|
| YouTube | No | — |
| Spotify | No | Optional API keys for better metadata |
| Apple Music | Yes | djdl auth |
$ djdl auth
============================================================
Apple Music Authentication
============================================================
To download from Apple Music, you need to provide your
media-user-token cookie.
Steps:
1. Open Chrome and go to: https://music.apple.com
2. Make sure you are logged in to your Apple Music account
3. Press F12 (or right-click → Inspect)
4. Go to: Application → Cookies → https://music.apple.com
5. Find the row named: media-user-token
6. Right-click on the value → Copy value
============================================================
Paste your media-user-token here: [paste-token]djdl <url> # Download track/playlist (auto-detect platform)
djdl set-folder [path] # Set output directory
djdl analyze [folder] # Analyze BPM/key for all tracks
djdl auth # Authenticate Apple Music
djdl update # Update djdl to latest version
djdl --help # Show help
All development tasks are run through the Makefile:
cd ~/.djdl
# Install the tool locally
make install
# Run tests
make test
# Lint
make lint
# Auto-fix lint issues
make lint-fix
# Format
make format
# Type check
make typecheck
# Run all quality checks (lint + format-check + typecheck)
make check
# Full validation (lint-fix + format + typecheck + test)
make validate
# Clean test artifacts
make cleanmake install # Install djdl via uv tool install
make uninstall # Remove djdl tool
make test # Run all tests
make test-q # Run tests quietly
make lint # Run ruff linter
make lint-fix # Auto-fix ruff issues
make format # Run ruff formatter
make format-check # Check formatting without modifying
make typecheck # Run type checker
make check # lint + format-check + typecheck
make validate # lint-fix + format + typecheck + test
make clean # Remove test artifacts and pycache
make test-auth # Run auth tests only
make test-integration # Run integration tests only
make test-rekordbox # Run rekordbox tests only
dj_dl/
cli.py # Typer CLI entry point
config.py # YAML configuration
downloader.py # Download manager with concurrency
metadata.py # Mutagen metadata embedder
analyzer.py # BPM/key detection with librosa
rekordbox_xml.py # Rekordbox XML export
auth.py # Apple Music authentication
providers/
base.py # BaseProvider ABC
youtube.py # YouTube provider (yt-dlp)
spotify.py # Spotify provider (metadata → YouTube)
applemusic.py # Apple Music provider (gamdl)
djdl updatecd ~/.djdl
make uninstallTo fully remove everything including the repo:
make uninstall
rm -rf ~/.djdl
# Remove the export PATH line from ~/.zshrc if addedMIT