A small utility to backup all your Spotify playlists including the folder structure. As the Spotify API does not support folders, the folder structure is reconstructed from the Spotify cache with spotify‑folders (all credit to mikez).
Playlists are automatically resolved to albums where appropriate. In this case, the individual tracks are not included in the backup.
- Prepare Spotify
- Clear cache in Spotify settings
- [Windows only] Fully close Spotify (Alt+F4)
- Prepare script
- Copy
.env.template
to.env
and fill in your Spotify credentials - [Optional] Specify a custom cache directory, account, or folder
by running spotify‑folders manually
and writing the result to
folders.json
- Copy
- Run script
- Install uv as described here
- Run with
uv run backup
- Result can be found in
Backup