A Python script that exports all of your Spotify playlists.
Go to file
Paweł Szramowski a9d7b29e42
Merge e24f115f42 into 0ccf12c9c7
2023-03-24 04:06:14 +02:00
.gitignore Ignore python cache 2020-10-05 06:32:20 +02:00
LICENSE Create LICENSE 2023-02-23 23:23:04 -08:00
README.md Add filtering playlists by name with wildcard support 2020-12-08 23:26:00 +01:00
spotify-backup.py Merge e24f115f42 into 0ccf12c9c7 2023-03-24 04:06:14 +02:00

README.md

spotify-backup

A Python script that exports all of your Spotify playlists, useful for paranoid Spotify users like me, afraid that one day Spotify will go under and take all of our playlists with it!

To run the script, save it from here and double-click it. It'll ask you for a filename and then pop open a web page so you can authorize access to the Spotify API. Then the script will load your playlists and save a tab-separated file with your playlists that you can open in Excel. You can even copy-paste the rows from Excel into a Spotify playlist.

You can run the script from the command line:

python spotify-backup.py --file playlists.txt

or, to get a JSON dump, use:

python spotify-backup.py --file playlists.json --format json

By default, it includes your playlists. To include your Liked Songs, you can use:

python spotify-backup.py --file liked_songs_and_playlists.txt --dump liked playlists

By default, it includes all your playlists. To include and/or exclude some, you can use:

python spotify-backup.py --file no_autogenerated_playlists.txt --exclude-playlists "Discover Weekly" "Release Radar"

python spotify-backup.py --file best_of_playlists_without_1980s.txt --include-playlists "Best of year *" --exclude-playlists "Best of year 198?"

If for some reason the browser-based authorization flow doesn't work, you can also generate an OAuth token on the developer site (with the playlist-read-private permission) and pass it with the --token option.

Collaborative playlists and playlist folders don't show up in the API, sadly.