This script allows you to export your Spotify playlists as CSV files, including the track name, artist, album, and URL.
-
Clone or download this repository to your local machine.
-
(Optional) Make virtual environment
-
Install the required dependencies by running the following command:
pip install -r requirements.txt
-
Obtain Spotify API credentials:
-
Create a Spotify Developer account at https://developer.spotify.com/.
-
Create a new Spotify application to get the Client ID and Client Secret.
-
Set the Redirect URI to a valid URI (e.g., https://developer.spotify.com/).
-
Note down the Client ID, Client Secret, and Redirect URI.
-
-
Rename a file named
config.py.sample
toconfig.py
in the project directory. -
Open
config.py
and add the following content, replacing the placeholder values with your actual Spotify API credentials
-
Run the script using the following command:
python main.py
-
The script will prompt you to authorize the application by visiting the provided authorization URL.
-
After authorizing the application, you will be redirected to the specified Redirect URI. Copy the authorization code from the URL. (ie the part after
?code=
) -
Paste the authorization code into the script's prompt.
-
The script will fetch your playlists and save each playlist as a separate CSV file in the
backup
folder. -
The CSV files will contain the track name, artist, album, and URL for each song in the playlist.
(Thanks GPT3.5)