Download music tracks, playlists, albums from Spotify using spotDL
Last Updated :
21 Sep, 2022
SpotDL is a cross-platform command-line utility written in Python via which we can download albums, playlists, individual tracks from Spotify. It is open-sourced and made available under the MIT License. It also applies metadata gathered from Spotify such as:
- Track Name and Number
- Album Name
- Album Cover
- Artist Name
- Genre
- Music Label
- Release Date
Prerequisites
Before installing spotdl make sure that the latest version of python, pip, and FFmpeg is already installed on your machine. To download and configure the above prerequisites, click on the following links.
- python 3: To compile and execute the application.
- pip: To download and install spotdl on your machine.
- FFmpeg: To convert playlist file format such as m3u to an mp3 file.
Installation
Now let’s begin with the installation process.
- For Windows, open cmd as an administrator and execute:
pip install spotdl
- For Linux/Mac, execute the following command in the terminal
sudo pip3 install spotdl
To verify the installation, run:
spotdl --version
verify version
Downloading individual track
Open Spotify in your browser and copy the URL of the track you want to download
Replace $url with the URL you just copied and run the following command :
spotdl $url
Downloading an album
Open Spotify in your browser and copy the URL of the album you want to download
Replace $url with the URL you just copied and run the following command :
spotdl $url
Downloading a playlist
Open Spotify in your browser and copy the URL of the playlist you want to download
Replace $url with the URL you just copied and run the following command :
spotdl $url
Downloading via the search feature
spotdl 'query'
Here, replace query with the name of the song.
Resuming a failed/incomplete download
spotdl 'path to the .spotdlTrackingFile'
.spotDlTrackingFile are automatically created once the download process starts, and they are deleted after the process gets completed. You can give the path to the .spotDlTrackingFile file in case of a failed/incomplete download and spotdl will automatically resume the incomplete download.
Chaining up multiple downloads
spotdl $trackUrl $albumUrl $playlistUrl 'query' ...
You can chain up multiple download tasks by separating the URL/query with spaces.
Uninstallation
- For Windows, open cmd as an administrator and execute:
pip uninstall spotdl
- For Linux/Mac, execute the following command in the terminal
sudo pip3 uninstall spotdl
Share your thoughts in the comments
Please Login to comment...