spotDL

Spotify Downloader

spotDL is a free, open-source Spotify downloader that turns tracks, albums, playlists and artists into organized local audio files - with metadata, album artwork and lyrics built in.

Terminal
pip install spotdl
Free & open source Runs 100% locally MIT licensed Windows · macOS · Linux

Spotify provides the track and playlist information. Audio is sourced from YouTube Music, YouTube or another configured provider - not from Spotify.

Spotify links in. Properly organized files out.

Streaming is great for discovering and organizing music, but it does not give you ordinary audio files you can manage on your own. spotDL connects those two workflows.

A Spotify link supplies structured details - song title, artist, album, release date, track number and cover art. spotDL searches a supported provider for a suitable match, downloads the audio, converts it when needed and embeds the metadata. The result is a portable music collection, not a folder full of unidentified downloads.

How spotDL works

Three steps from a Spotify link to a tagged, ready-to-play music file.

1

Add a Spotify link or search query

Paste a link to a track, album, playlist or artist - or find a song with a plain text search. Several links and queries can go in the same command.

Terminal
spotdl download "The Weeknd - Blinding Lights"
2

spotDL finds the audio

spotDL reads the Spotify metadata and searches YouTube Music by default. Matching and filtering separate the intended recording from covers, remixes, live versions and unrelated results.

Terminal
spotdl download https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b
3

Save a complete music file

The audio is processed with FFmpeg, then metadata, artwork and available lyrics are embedded automatically - with the format, folders, filenames and overwrite behavior fully configurable.

Terminal
spotdl download [URL] --output "{artist}/{album}/{track-number} - {title}.{output-ext}"

More than a basic downloader

One focused application for turning Spotify links into a structured, maintainable music library.

Tracks, albums, playlists & artists

Accept Spotify URLs for individual tracks, full albums, playlists and artist pages - plus text searches and mixed batches.

Automated track matching

Spotify metadata builds and filters the search to identify a suitable recording instead of the first loosely related video.

Embedded metadata

Title, artists, album, album artist, artwork, track & disc numbers, year, genre, label, ISRC, Spotify ID and lyrics.

Lyrics & synced .lrc files

Collect lyrics from Genius, Musixmatch or AZLyrics, and generate separate synchronized .lrc files for compatible players.

Six output formats

MP3, M4A, Opus, OGG, FLAC and WAV - pick what your player or workflow needs.

Configurable filenames & folders

Output templates build a predictable {artist}/{album} library instead of a flat folder of inconsistent names.

M3U playlist generation

Create M3U or M3U8 playlist files alongside the audio, including a separate file per list in a multi-list job.

Duplicate & overwrite control

Skip, refresh metadata, force a re-download, scan for existing songs or keep an archive of completed downloads.

Multiple audio providers

YouTube Music by default, with YouTube, SoundCloud, Bandcamp, Piped and slider.kz as alternatives or fallbacks.

Playlist synchronization

A .spotdl sync file keeps a local folder aligned with a changing Spotify playlist or album over time.

Reusable configuration

Save preferred formats, templates, providers, threads and rules once - they load automatically on every run.

Local Web UI

A simple browser interface for individual downloads, hosted on your own machine - not a remote conversion service.

Download spotDL

Windows

64-bit executable (.exe)

Download

macOS

Native binary

Download

Linux

x86-64 binary

Download

Prebuilt app: opening it without arguments launches the local Web UI for simple single-track downloads. Playlist sync, batch jobs and advanced controls live in the command line. FFmpeg is still required (spotdl --download-ffmpeg) and Deno is recommended (spotdl --download-deno).

Install with Python

Installing through Python is recommended for regular use, updates, automation and the complete command-line feature set. Requirements: Python 3.10-3.14, FFmpeg 4.2+, Deno recommended, and the Visual C++ Redistributable on Windows.

Terminal
pip install spotdl

# update an existing install
pip install --upgrade spotdl

Docker

A maintained image suits servers, NAS systems and reproducible environments. The mounted music directory must be writable by the container user.

Terminal
docker pull spotdl/spotify-downloader

docker run --rm -v $(pwd):/music \
  spotdl/spotify-downloader download [Spotify URL]

Termux, Arch & source builds

spotDL also installs on Android via Termux, through the Arch User Repository, or by building the executable from source with uv.

Terminal
# Termux (Android)
curl -L https://raw.githubusercontent.com/spotDL/spotify-downloader/master/scripts/termux.sh | sh

# Build from source
git clone https://github.com/spotDL/spotify-downloader
cd spotify-downloader
pip install uv
uv sync
uv run scripts/build.py

Required components

FFmpeg

FFmpeg is required to process, convert and tag audio. Install it directly into the spotDL directory, or system-wide via your package manager.

Terminal
spotdl --download-ffmpeg

# or system-wide
brew install ffmpeg            # macOS
sudo apt install ffmpeg        # Debian / Ubuntu

Deno

Deno is strongly recommended: current YouTube downloads through yt-dlp may require a JavaScript runtime. Without it, some tracks can fail, including certain videos marked as made for children.

Terminal
spotdl --download-deno

Spotify authentication

Public links work for standard track, album, playlist, artist and search workflows. Accessing private account data - liked songs, personal playlists, followed artists, saved albums - requires Spotify authentication, and some shortcuts also need the official Spotify API option with valid credentials.

Start with one command

The default operation is download. Files are saved to the folder you run spotDL in, unless an --output path is set.

Terminal
# a single track
spotdl download [track URL]

# a full album
spotdl download [album URL]

# a playlist
spotdl download [playlist URL]

# an artist's catalog
spotdl download [artist URL]

# search by name
spotdl download "Artist - Song Title"

# several items at once
spotdl download [track URL] [album URL] "Artist - Song Title"

If the spotdl command is unavailable but the package is installed, run it as a module with python -m spotdl [query] (or python3 -m spotdl on macOS / Linux).

Choose a specific YouTube match

Automatic matching aims for the intended recording, but you can pair a specific YouTube source with Spotify metadata when you want exact control over the audio used.

Terminal
spotdl download "https://www.youtube.com/watch?v=XXYlFuWEuKI|https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b"

Download a personal Spotify library

Authenticated shortcuts can process liked songs, all your playlists, saved playlists, followed artists and saved albums. These require Spotify authentication; the current official-API workflow is intended for Spotify Premium accounts.

Terminal
spotdl download saved --user-auth --use-official-api
spotdl download all-user-playlists --user-auth --use-official-api
spotdl download all-saved-playlists --user-auth --use-official-api
spotdl download all-user-followed-artists --user-auth --use-official-api
spotdl download all-user-saved-albums --user-auth --use-official-api

Auth flags include --user-auth, --use-official-api, --client-id, --client-secret, --auth-token, --cache-path, --no-cache, --headless and --max-retries. Treat credentials and tokens as private - never commit them to a public repository.

Six core operations

download

Downloads audio and embeds available metadata.

Terminal
spotdl download [query]

save

Collects Spotify metadata into a .spotdl file without downloading audio.

Terminal
spotdl save [query] --save-file songs.spotdl

sync

Keeps a local folder aligned with a Spotify playlist or album.

Terminal
spotdl sync [query] --save-file list.spotdl

meta

Updates metadata, artwork and tags on existing audio files.

Terminal
spotdl meta [audio files]

url

Resolves the songs in a query to their matching audio URLs.

Terminal
spotdl url [query]

web

Starts the local Web UI in the browser.

Terminal
spotdl web

Keep local playlists in sync

A downloaded playlist does not have to become an outdated snapshot. The sync operation compares your local folder with the current Spotify source: new tracks are downloaded, and tracks removed from the source can be removed locally.

Terminal
# create a sync file
spotdl sync [playlist URL] --save-file playlist.spotdl

# update the collection later
spotdl sync playlist.spotdl

# add new tracks without deleting local files
spotdl sync playlist.spotdl --sync-without-deleting

By default, sync mirrors the source and may delete tracks removed from Spotify. Use --sync-without-deleting to keep local files, or --sync-remove-lrc to also remove matching .lrc files when songs are removed. Ideal for playlists that change weekly and automated library updates.

How track matching works

spotDL builds a search from Spotify details - title, artists, album, duration, release type - and evaluates candidate results, weighing whether a result is verified and watching for terms tied to live versions, remixes, covers and alternate recordings. It reduces the risk of grabbing an unrelated upload, but no matching system is perfect.

Control matching with --search-query (custom template), --dont-filter-results, --only-verified-results, --album-type, or a manual YouTubeURL|SpotifyURL pairing for an exact source.

Audio providers

YouTube Music is the default. Configure several providers in fallback order - if the first cannot return a suitable result, spotDL tries the next.

YouTube Music (default)YouTubeSoundCloudBandcampPipedslider.kz
Terminal
spotdl download [query] --audio youtube-music youtube soundcloud bandcamp

Provider availability, regional access, authentication, audio quality and search accuracy vary. A track on Spotify is not guaranteed to be available from any given audio provider.

Six output formats

Pick the format your target player or workflow needs. Set it with --format.

MP3

The default. Broad compatibility across players, cars, phones, media servers and older hardware.

M4A

Useful when the source is already compatible and unnecessary transcoding should be avoided.

Opus

Efficient compression that can preserve the source without another conversion when settings allow.

OGG

For players and workflows that require an open container format.

FLAC

For tagging and library standardization. Converting a lossy source to FLAC does not restore lost audio.

WAV

Uncompressed PCM for applications that require it. Larger files, no quality gain over a lossy source.

Audio quality, without misleading claims

spotDL downloads the audio available from the selected provider. It does not download Spotify's own streams, and it cannot create quality that is absent from the source. Standard YouTube sources generally provide up to 128 kbps; YouTube Music Premium users can reach 256 kbps with authenticated cookies and compatible M4A or Opus settings.

Choosing 320 kbps, FLAC or WAV does not turn a lower-bitrate source into higher quality - it only makes a larger file. For minimal processing, use M4A or Opus with conversion disabled; for maximum compatibility, use the default MP3.

Terminal
# skip unnecessary conversion
spotdl download [URL] --format m4a --bitrate disable

# maximum compatibility
spotdl download [URL] --format mp3

Bitrate accepts constant rates from 8-320 kbps, variable levels 0-9, auto (match the source) or disable. With M4A and Opus, auto or disable can skip conversion when the source is already compatible.

Metadata, artwork & lyrics

Files can include everything a modern player and library manager expects. Metadata can also be applied to existing audio with the meta operation.

Track titlePrimary & featured artistsAlbum & album artistAlbum artworkTrack & disc numbersRelease year & original dateGenrePublisher / record labelISRCSpotify track IDLyricsDuration

Album artwork is embedded by default. For playlists, --playlist-numbering uses the playlist title and image as album/artwork, while --playlist-retain-track-cover keeps each track's own cover. Lyrics come from Genius, Musixmatch or AZLyrics in fallback order, and a synced provider can generate separate .lrc files.

Terminal
spotdl download [query] --lyrics synced genius --generate-lrc

Control file and folder names

The default template is {artists} - {title}.{output-ext}. A custom template can define filenames, directories or both - producing a predictable library instead of a flat folder.

Terminal
spotdl download [query] \
  --output "{artist}/{album}/{track-number} - {title}.{output-ext}"
VariableMeaning
{title}Song title
{artists}All song artists
{artist}Primary artist
{album}Album title
{album-artist}Primary album artist
{genre}Genre
{year}Release year
{original-date}Original release date
{track-number}Album track number
{tracks-count}Total tracks in the album
{disc-number}Disc number
{isrc}International Standard Recording Code
{track-id}Spotify track ID
{publisher}Publisher or record label
{list-name}Playlist or collection name
{list-position}Position in the playlist
{output-ext}Output file extension

Limit length with --max-filename-length and sanitize names for device compatibility with --restrict strict|ascii|none. The operating system may still enforce a shorter maximum path.

Library & automation controls

M3U playlists

Generate M3U or M3U8 files alongside the audio with --m3u, choose a name with --m3u "My Playlist.m3u8", or one file per list with --m3u "{list}". Record unavailable songs in M3U and archive files with --add-unavailable.

Duplicates & overwrite

Three overwrite modes - --overwrite skip (keep existing), --overwrite metadata (refresh tags, keep audio) and --overwrite force (re-download). Add --scan-for-songs to detect existing tracks, --archive to record completed downloads, and --create-skip-file / --respect-skip-file for idempotent batch jobs.

Filter the collection

Skip explicit tracks with --skip-explicit, ignore albums with --ignore-albums, fetch a song's albums with --fetch-albums, limit release type with --album-type single|album|compilation, accept only verified results with --only-verified-results, or disable filtering with --dont-filter-results.

Manage errors in large downloads

Long jobs can contain unavailable tracks, regional restrictions and provider failures. Print a summary with --print-errors or save it with --save-errors errors.txt, so you can process a large collection first and review exceptions afterward.

Advanced download controls

Tune throughput and behavior with --threads, --ffmpeg / --ffmpeg-args, --yt-dlp-args, --proxy http://host:port, --sponsor-block and --detect-formats. Custom tool arguments are intended for experienced users and can conflict with spotDL defaults.

Run the local Web UI

Start the browser interface with spotdl web. It is hosted locally - not on a remote conversion service - and is best for simple single-track downloads. Configure it with --host, --port (default 8800), --keep-alive, --allowed-origins and TLS options (--enable-tls, --cert-file, --key-file). Use --web-use-output-dir to follow your normal --output location.

Save configuration once

Generate a config file with spotdl --generate-config; it loads automatically on every run. It can store providers, formats, bitrate, output templates, FFmpeg/yt-dlp settings, threads, cookie files, proxy, overwrite rules, sync behavior and Web UI settings. Disable auto-loading with { "load_config": false }.

JSON
# default config locations
Windows:  C:\Users\<user>\.spotdl\config.json
Linux:    ~/.config/spotdl/config.json

Logging & diagnostics

Set verbosity with --log-level (CRITICAL → DEBUG, plus a MATCH level), simplify the terminal with --simple-tui, customize output with --log-format, profile with --profile, and see everything with spotdl --help.

Built for real music libraries

Take a curated playlist offline

Convert a Spotify playlist into standard files for a laptop, phone, car, portable player or offline library.

Download complete releases

Process an album as a single job while preserving track numbers, disc numbers, release info and artwork.

Build an artist collection

Use an artist link to process the available catalog without submitting every release individually.

Move music between devices

Files are not locked to one app - copy, back up, rename, index and play them anywhere.

Maintain a self-hosted library

Custom templates and standard metadata suit music servers, NAS collections and archival folders.

Automate recurring workflows

Config files, archives, skip files, saved metadata and sync commands make repeat jobs reproducible.

Troubleshooting

Quick fixes for the most common installation and download problems.

'spotdl' is not recognized on Windows+

Python or its Scripts directory is not on PATH. Reinstall Python from python.org and tick “Add Python to PATH”, then restart the terminal. Microsoft Store Python can cause command-resolution problems.

spotdl: command not found on Linux/macOS+

The user-install bin directory is missing from PATH. Add it and reload your shell config:

Terminal
export PATH=~/.local/bin:$PATH
Missing yt-dlp dependencies+

Install or update the required packages:

Terminal
pip install brotli websockets yt-dlp -U
AudioProviderError: YT-DLP download error+

Some YouTube downloads need a JavaScript runtime, including certain videos marked as made for children. Install Deno:

Terminal
spotdl --download-deno
HTTP 404 from Spotify metadata / recursion error+

An old release may rely on changed API behavior. Update spotDL:

Terminal
pip install -U spotdl
SSL: CERTIFICATE_VERIFY_FAILED+

Update the OS certificate store and Python certificate bundle. On macOS, run the certificate-installation script included with your Python install. Disabling verification is not a safe fix.

Apple Silicon _raw_ecb / Cryptodome error+

Python and a compiled dependency were installed for different architectures. Use a native Apple Silicon Python and reinstall the affected dependencies in the same environment.

YouTube Music KeyError: 'header'+

Update ytmusicapi, then force-reinstall spotDL if it persists. YouTube Music can occasionally change its response or trigger anti-bot behavior; retrying later may resolve it.

Terminal
pip install -U ytmusicapi

Frequently asked questions

What is spotDL?+

spotDL is a free, open-source Spotify downloader that turns Spotify tracks, albums, playlists and artist links into organized local audio files. It uses Spotify to identify the music and collect metadata, then finds matching audio through supported providers such as YouTube Music.

Does spotDL download audio directly from Spotify?+

No. Spotify supplies information such as the track title, artist, album, release date, track number and artwork. The audio itself is downloaded from YouTube Music, YouTube or another configured provider when a suitable match is available.

Can spotDL download an entire Spotify playlist?+

Yes. A playlist link can be processed as a single job. spotDL finds the corresponding audio, downloads each available track, embeds metadata and organizes the files according to your output settings. Large playlists take time, and individual tracks can be skipped when no reliable match is found.

Can downloaded playlists be updated later?+

Yes. The sync operation compares a saved local collection with the current Spotify playlist. New tracks are downloaded automatically, and tracks removed from Spotify can also be deleted from the folder. Deletion can be disabled with --sync-without-deleting.

Which audio formats does spotDL support?+

spotDL supports MP3, M4A, Opus, OGG, FLAC and WAV. MP3 is the default and offers the widest compatibility. M4A and Opus can reduce unnecessary conversion when used with compatible source settings.

Can spotDL download 320 kbps or lossless audio?+

spotDL cannot create quality that is not in the source. Standard YouTube sources generally provide up to 128 kbps, while authenticated YouTube Music Premium sources can reach 256 kbps. Selecting 320 kbps, FLAC or WAV only converts the existing source into a different (often larger) file - it does not restore missing audio.

Does spotDL add album artwork, lyrics and metadata?+

Yes. Depending on availability and configuration, files can include the title, artists, album, album artist, artwork, track and disc numbers, release date, genre, publisher, ISRC, Spotify track ID and lyrics. spotDL can also create synchronized .lrc lyric files.

How accurate is the track matching?+

spotDL uses Spotify metadata to search and evaluate available results before downloading, which helps separate the studio recording from covers, remixes, live versions and unrelated videos. Matching is not infallible - you can pair a specific YouTube URL with a Spotify track when exact control is required.

Is there a graphical interface?+

Yes. spotDL includes a local Web UI for straightforward individual-track downloads, running on your own computer rather than a remote service. The command line provides the full feature set, including playlist synchronization, batch processing, advanced providers and configuration.

Which operating systems support spotDL?+

spotDL runs on Windows, macOS and Linux, with installation options for Docker, Termux, Arch Linux and source builds. Compatibility depends on the chosen method and required components such as Python and FFmpeg.

What is required to run spotDL?+

FFmpeg is required for audio processing, conversion and tagging (install it with "spotdl --download-ffmpeg"). Deno is strongly recommended because some YouTube downloads need a JavaScript runtime ("spotdl --download-deno"). The recommended install is "pip install spotdl".

Is spotDL free?+

Yes. spotDL is distributed under the MIT License and can be downloaded, used, inspected, modified and redistributed under those terms. There is no paid spotDL subscription. External platforms, providers or premium accounts may have their own separate terms and costs.

Is spotDL affiliated with Spotify or YouTube?+

No. spotDL is an independent open-source project and is not affiliated with, sponsored by or endorsed by Spotify, YouTube, Google or any record label. Spotify and YouTube are trademarks of their respective owners.

Is it legal to use spotDL?+

spotDL is a general-purpose software tool. Whether a particular download is permitted depends on the music, source, intended use, applicable copyright law and the relevant platforms’ terms. Downloading a file does not grant ownership or redistribution rights. Only use spotDL for audio you are legally permitted to download, copy or process.

Build a music library that stays portable

Start with one song, convert a full playlist, or build a repeatable local workflow with complete control over formats, metadata, filenames and synchronization.

Free & open source MIT licensed Runs locally Built for long-term collections