This project has been archived by its maintainers, and is no longer receiving any updates.
spotify-dlp
Command line downloader for spotify tracks, playlists, albums and top artists songs.
It works by taking the metadata out of these items using the Spotify API 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.
Installation
-
After having installed Python 3 with pip, you can install spotify-dlp using the following command:
pip install spotify-dlp
-
Then, you can authenticate your Spotify account by running this command and following the instructions:
spotify-dlp --authThe authentication tokens should get saved automatically and used for future commands.
Arguments
| Command | Example | Short Description |
|---|---|---|
| "kid a album" | The words to search up or a link to a spotify album, artist, playlist or track. Include keywords like album or playlistto specify the type of item to search for. |
|
-a --auth |
Authenticate using the client credentials flow and exit. | |
-i --client-id |
"qwertyuiop" | The Spotify Client ID. |
-s --client-secret |
"asdfghjkl" | The Spotify Client Secret. |
-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 download metadata (such as covers). | |
-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.
Metadata
Release files for spotify-dlp 2.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spotify_dlp-2.6.0.tar.gz | 11.9 kB | Without provenance | Details for spotify_dlp-2.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spotify_dlp-2.6.0-py3-none-any.whl | Python 3 | none | any | Details for spotify_dlp-2.6.0-py3-none-any.whl |
Total release size: 23.6 kB
Release files / spotify_dlp-2.6.0.tar.gz
| Download URL | spotify_dlp-2.6.0.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1849dd4b0f4d9104a0bc2e08775a81cad5b36273e13c3cf86e771e0d502fc55a
|
|
BLAKE2b-256 checksum How to use checksums |
ea67c8f388237c4a3ceb751a9f4d3dfd0247df0586ed2b6d61838471923dbe48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.11
|
Release files / spotify_dlp-2.6.0-py3-none-any.whl
| Download URL | spotify_dlp-2.6.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
458264a1c50a77ee9d161ad71383682f48d88c98f70caa5f0b008f7b7683c15e
|
|
BLAKE2b-256 checksum How to use checksums |
cacb5b250137f14b18f94ede15e6fed661eda2f6dd8c8ae8fe08ecbbbbca5c67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.11
|
Security for spotify-dlp 2.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.