spotify-backup
A Python script that exports all of your Spotify playlists, useful for paranoid Spotify users afraid that one day Spotify will go under and take all of our playlists with it!
Overview
This tool exports your Spotify playlists to a local file, giving you a backup of your music data. It supports both TSV (tab-separated) format for Excel and JSON format for programmatic use.
Features
- Export all playlists to TSV or JSON format
- Include your Liked Songs alongside playlists
- Simple browser-based OAuth authorization
- Command-line interface for automation
- Optional token-based auth for headless environments
Usage
Interactive Mode
Save the script 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.
Command Line
# Export to TSV (Excel-compatible)
python spotify-backup.py playlists.txt
# Export to JSON
python spotify-backup.py playlists.json --format=json
# Include Liked Songs
python spotify-backup.py playlists.txt --dump=liked,playlists
# Use existing OAuth token
python spotify-backup.py playlists.txt --token=YOUR_TOKENJSCOM Edits
This fork includes the following additions:
- Added
date_addedto TSV exports for tracking when songs were added to playlists
Limitations
- Collaborative playlists don't show up in the API
- Playlist folders aren't accessible via the API
Future Plans
- Export playlists as multiple files (one per playlist)
- Script to convert existing JSON exports to TSV