A little script a made in order to convert my Spotify playlists to an mp3 format since I wanted to play them on my mp3 player.
- Copy and paste the links to all of the playlists you want to download in the
playlist_links.txt
file in the root directory- Your links should look something like
https://open.spotify.com/playlist/XXXXXXXXXXXX
- Make sure you paste only one link per line
- Your links should look something like
- Open the command line, go into this project's root folder and create a virtual environment with
python -m venv venv
- Install the dependency libraries using
pip install -r requirements.txt
- Put your API keys in the file
src/utils/client_keys.py
(scroll down to see the file template)- Get your Spotify API keys (follow this link
- Get your Youtube Data API Key (this article can explain better than me)
- Make sure
ffmpeg
is installed (I found this thread really useful for it)
CLIENT_ID = 'Your Spotify ID'
CLIENT_SECRET = 'Your Spotify Secret ID'
YOUTUBE_API_KEY = 'Your YouTube Data API Key'
- Read a Spotify playlist link from a file
- Connect to Spotify and retrieve the name of every song in the playlist
- Search the internet for a link of each song
- Download the song and put it in a folder with the playlist's name
- Keep song metadata with mp3