从Spotify播放列表下载MP3:获取元数据、搜索YouTube对应曲目、使用ffmpeg转码,可选使用Spotify API凭证。
Use this skill when the user wants to download MP3 files from a Spotify playlist.
Python 3.10+ - Required
ffmpeg - Required for audio conversion
brew install ffmpegsudo apt install ffmpegchoco install ffmpeg or download from https://ffmpeg.orgOption 1: uvx (no install needed)
bash
uvx spotify-download "https://open.spotify.com/playlist/..."
Option 2: pip install
bash
pip install spotify-download
spotify-download "https://open.spotify.com/playlist/..."
Option 3: pipx
bash
pipx install spotify-download
spotify-download "https://open.spotify.com/playlist/..."
Option 4: Local development
bash
git clone https://github.com/zesong/spotify-download.git
cd spotify-download
pip install -e .
spotify-download "https://open.spotify.com/playlist/..."
Public playlists: No credentials needed - the tool uses Spotify's embed page to fetch metadata.
Private playlists or more accurate metadata: Get credentials:
Then use either:
bash
spotify-download "https://..." --client-id "XXX" --client-secret "YYY"
Or set environment variables:
bash
export SPOTIFY_CLIENT_ID="your-client-id"
export SPOTIFY_CLIENT_SECRET="your-client-secret"
spotify-download "https://..."
bash
uvx spotify-download "https://open.spotify.com/playlist/5TFrk1Wdap4jufziW7SyIh"
FlagDescriptionDefault-o, --outputOutput directorydownloads``-w, --workersConcurrent downloads4``-d, --delaySearch delay (seconds)1.0``--json-outputSave playlist JSON path<output>/playlist.json``--skip-exportSkip export, use existing JSON-
bash
# Download to custom directory
uvx spotify-download "https://open.spotify.com/playlist/..." -o ~/Music/my-playlist
# Faster downloads
uvx spotify-download "https://open.spotify.com/playlist/..." -w 8
# Save playlist JSON for later
uvx spotify-download "https://open.spotify.com/playlist/..." --json-output my-playlist.json
# Re-download from saved JSON (skip export)
uvx spotify-download --skip-export --json-output my-playlist.json -o ~/Music
# With credentials for private playlist
uvx spotify-download "https://open.spotify.com/playlist/..." --client-id XXX --client-secret YYY
Files saved to <output>/music/ as {Artist} - {Track Name}.mp3:
text
downloads/
├── playlist.json # Playlist metadata
└── music/
├── Eason Chan - 任我行.mp3
├── Mayday - 突然好想你.mp3
└── ...
Install ffmpeg:
brew install ffmpegsudo apt install ffmpegSpotify's embed page structure may have changed. Use API credentials:
bash
spotify-download "https://..." --client-id "your-id" --client-secret "your-secret"
YouTube search may not find the right match. Re-run the command - it skips already-downloaded tracks.
The tool: