spotidl: download songs, albums and playlists using Spotify links
Project description
Introduction
spoti-dl(I had a better name but that was already taken on PyPi), is a song downloader app that accepts Spotify links, fetches individual song—and basic album—metadata from Spotify, downloads the song from Youtube. The metadata is then written onto the downloaded song file using the trusty Mutagen library, this includes the album/song cover art as well.
The app currently supports downloading songs, albums and playlists.
I got the inspiration for the project from my friend Swapnil's spotify-dl app written in JavaScript. This seemed like the perfect pet project to make and consequently learn from :)
Setup
Run pip install spoti-dl
to install the app first and foremost.
spoti-dl needs two things to work: FFmpeg and a Spotify developer account.
Steps to make a Spotify developer account:
- Go to Spotify Dev Dashboard
- Login with your credentials and click on "create an app".
- Enter any name of choice, app description, tick the checkbox and proceed.
- Now you have access to your client ID. Click on "Show client secret" to get your client secret.
- From here, click on "edit settings" and in the "redirect URIs" section add any localhost URL. I personally use
http://localhost:8080/callback
Finally, define these three environment variables:
SPOTIPY_CLIENT_ID
SPOTIPY_CLIENT_SECRET
SPOTIPY_REDIRECT_URI
Also note that the first time you run the app you might get a popup window in your browser asking to integrate your account to the app you just created in the Spotify app dashboard. Accept and close the window.
Usage
MP3 is the selected codec (audio file format; MP3 is the standard) and 320KBPS the selected bitrate (audio quality). So by default, running this downloads the song/album/playlist with these defaults-
spotidl <spotify link>
as an example, running this would download Rick Astley's 'Never Gonna Give You Up'-
spotidl https://open.spotify.com/track/4PTG3Z6ehGkBFwjybzWkR8?si=06f5d7ab5bd240e7
The following audio formats are supported:
- mp3
- flac
- m4a (the m4a format only has partial textual-metadata support 😅))
The following bitrates are supported:
- best
- 320kbps
- 256kbps
- 192kbps (slightly better than Spotify's 'high' audio setting, this is the bare minimum in my opinion to have a good listening experience)
- 96kbps
- 32kbps
- worst
Again, the following link types are supported:
- song links
- album links
- playlist links
Note: File names (audio files or folder names (eg., playlist's directory name)) are changed to ensure compatibility with the operating systems since many characters like '?' or the '/' are illegal when making files/folders.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spoti-dl-0.9.6.tar.gz
.
File metadata
- Download URL: spoti-dl-0.9.6.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.8.10 Linux/5.10.60.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1076846a9cb6ed9761b74b9705fb384141ffa41732930d9b071b1145afaff3c0 |
|
MD5 | de77f88a08e3aac595bb7fe61d04210b |
|
BLAKE2b-256 | 1ee3126de5efbe10e2e8a1f9eb577873d55f82ab42a67ee598709af6987ca547 |
File details
Details for the file spoti_dl-0.9.6-py3-none-any.whl
.
File metadata
- Download URL: spoti_dl-0.9.6-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.8.10 Linux/5.10.60.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a26258d3ecf6cc19a88e562279a0a29bac099845f0b438b2681df0d2b19d4651 |
|
MD5 | 952c79d20e2bf4de26ec3c2578cdca1b |
|
BLAKE2b-256 | 6e4abc8167243bff88e324af32fe98eaf39f560aa98abd083166f024b550e189 |