- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Downloaded tracks had no tags, so they showed up as "unknown" in music players. They are now tagged with mutagen (mp3, m4a, flac, opus, vorbis, wav) with title, artists, album, album artist, date, track & disc number and the embedded album cover. - Add album_authors and disc fields to SpotifyItem - Single track links use their album's tracklist for complete metadata - --metadata now only saves the covers as separate image files - Sanitize album names used as cover filenames - Add mutagen as an explicit dependency Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
| spotify_dlp | ||
| .gitattributes | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
| setup.py | ||
spotify-dlp
Note
This is a fork of zWolfrost/spotify-dlp, which has been archived on GitHub and no longer works, as every request to the official Spotify API now fails with a 403 error (since February 2026, Spotify requires the app owner to have a Premium subscription). This fork fixes that by fetching metadata without authentication, and adds some other improvements (see the changelog for 2.7.0 onwards). All credit for the original project goes to its author, zWolfrost.
The
spotify-dlppackage on PyPI is the original, unmaintained version (2.6.0), so install this fork from source as shown below.
Command line downloader for spotify tracks, playlists, albums and artists discographies.
It works by taking the metadata out of these items from Spotify's web player and public embed pages (no account or API keys required) and searching them up on YouTube.
Then, it downloads the result by using yt-dlp.
This technically means that the tracks have a really small chance to be incorrect.
The downloaded tracks are tagged with the metadata from Spotify (title, artists, album, date, track number, cover, ...).
Installation
-
After having installed Python 3 and pipx, you can install this fork using the following command:
pipx install git+https://git.lainlounge.org/hornet/spotify-dlpFor YouTube downloads to work reliably, a JavaScript runtime such as Deno or Node.js should also be installed.
-
That's it, no authentication is needed. Optionally, you can save the Client ID and Client Secret of a Spotify app, which will be used as a fallback through the official Spotify API in case the unauthenticated method stops working:
spotify-dlp --authNote that since February 2026, the owner of the Spotify app needs an active Premium subscription for the official API to work.
Arguments
| Command | Example | Short Description |
|---|---|---|
| "kid a album" | The words to search up or a link to a spotify album, artist (whole discography), playlist or track. Include keywords like album or playlistto specify the type of item to search for. |
|
-a --auth |
Save a Client ID and Client Secret, used as a fallback for the official Spotify API (optional), and exit. |
|
-i --client-id |
"qwertyuiop" | The Spotify Client ID (optional). |
-s --client-secret |
"asdfghjkl" | The Spotify Client Secret (optional). |
-f --format |
"{index}. {title}" | The format of the downloaded tracks' names. Set to help for a list of available fields. |
-r --range |
"2:6,10" | The beginning and ending index of the list items to download, separated by a colon " :" (1-based). Multiple ranges can be specified with a comma " ,". |
-o --output |
"./album/" | The output path of the downloaded tracks. |
-c --codec |
"mp3" | The audio codec of the downloaded tracks. Requires ffmpeg to be installed. |
-m --metadata |
Whether to also save album covers as separate image files (metadata and covers are always embedded in the tracks). |
|
-b --browser |
"chrome" | The name of the browser from which cookies should be extracted, to bypass the age restriction. |
-y --yes |
Whether to skip the confirmation prompt. | |
-v --verbose |
Whether to display verbose information and full errors. | |
-h --help |
Show the help message and exit. |
Usage Examples
spotify-dlp jigsaw falling into place
spotify-dlp spirit phone album -o "./Desktop/spotify" -c mp3 -y
spotify-dlp https://open.spotify.com/album/2Vq0Y8wgiZRYtZ1mQ7zOMG -i "your_client_id" -s "your_client_secret"
Screenshots
Changelog
This changelog only includes changes that are worth mentioning.
- 2.0.0:
- Basically, everything changed. Also added package to PyPI.- 2.0.1:
- Fixed--verboseargument not working.
- Made youtube search more accurate.
- Better error handling.
- 2.0.1:
- 2.1.0:
- Added some QOL features.
- Fixed bug where a playlist with more than 100 tracks would be cut off.
- Better error handling.- 2.1.1:
- Fixed bug where track indexes would not show.
- Fixed bug where an album with more than 50 tracks would be cut off. - 2.1.2:
- Fixed bug where an error with a track would stop the whole process. - 2.1.3:
- Fixed bug where an already downloaded track would be downloaded again.
- Added colors to the output.
- Minor tweaks.
- 2.1.1:
- 2.2.0:
- Added--metadataargument, which allows cover downloading.
- Fixed bug where a playlist with an episode in it would error out.
- Fixed bug where the -c argument would give files double extensions. - 2.3.0:
- Removed client credentials authentication trough environment variables!
- Added--authargument, which allows for easy PKCE/browser authentication.
- Way more accurate youtube search (but a little slower)
- Better error handling.- 2.3.1:
- Fix windows path issues and terminal colors. - 2.3.2:
- Fixed port conflicts with--authargument.
- Faster searching.
- 2.3.1:
- 2.4.0:
- Removed authentication via PKCE flow, as spotify only supports up to 25 users for apps not made by companies. - 2.5.0:
- Added config file support.
- Renamed--sliceargument to--range.
- Added comma (",") support for--rangeargument.
- The item type can be now specified in the search query; removed--typeargument.- 2.5.1:
- Fixed wrong config path message on Windows.
- Fixed "Requested format is not available" error.
- Other small bug fixes. - 2.5.2:
- Fixed "Requested format is not available." error.
- 2.5.1:
- 2.6.0:
- Added--browserargument which allows importing cookies from a browser. - 2.7.0:
- Fixed every request failing with a 403 error, as the official Spotify API now requires the app owner to have a Premium subscription. Metadata is now fetched without authentication, from Spotify's web player and public embed pages.
- Artist links now download the artist's whole discography (albums, EPs, singles and compilations, without duplicates) instead of their top tracks.
- Playlists, albums and tracks now include more accurate metadata (e.g. track numbers and release dates).
- The Client ID and Client Secret are now optional, and only used as a fallback.
- YouTube downloads failing with a 403 error are now retried, and any installed JavaScript runtime (Deno, Node.js, Bun, QuickJS) is now used to solve YouTube's challenges.- 2.7.1:
- Metadata (title, artists, album, album artist, date, track & disc number) and the album cover are now embedded in the downloaded tracks, so they no longer show up as "unknown" in music players.
- The--metadataargument now only saves the album covers as separate image files, as they are always embedded in the tracks.
- Fixed album covers failing to save when the album name contains characters such as "/".
- 2.7.1:
