A script to automatically add all songs from a Spotify playlist to your library (Liked Songs).
- Because I don’t see the point of playlists — I keep everything in Liked Songs, but when I transfer tracks from other apps, they all end up as separate playlists
- I just want to
- Automatic Spotify OAuth authorization
- Fetches all tracks from a playlist (including large ones)
- Skips tracks that are already liked
- Adds tracks to your library in batches
- Detailed progress output
- Python 3.6+
- Spotify Developer Account
- Client ID and Client Secret from your Spotify App
- Clone the repository or download the files
- Go to the Spotify Developer Dashboard
- Click "Create app"
- Fill in:
- App name: anything (e.g., "Playlist Liker")
- App description: anything
- Redirect URI:
http://example.com/callback
- Save the app
- Copy the Client ID and Client Secret
On first run, the script will prompt you to enter your credentials.
python3 -m venv venv
source venv/bin/activate
python spotify_like_playlist.py- A browser will open to authorize the app via Spotify
- Grant access to the app
- You'll be redirected to
example.com— copy the full URL from the address bar and paste it into the terminal when prompted - Enter the playlist URL or ID:
- Full URL:
https://open.spotify.com/playlist/37hfuiahfibqiwbgfiuer - Just the ID:
37hfuiahfibqiwbgfiuer
- Full URL:
- The script will show playlist info and the number of new tracks
- Confirm to add the tracks to your library
- The Spotify API allows adding up to 50 tracks per request
- The script automatically splits large playlists into chunks
- Already liked tracks are skipped
- For private playlists, you must be the owner or have access
- "Redirect URI mismatch" — Make sure the Spotify App has
http://example.com/callbackset as a redirect URI - "Invalid client" — Check that your Client ID and Client Secret are correct
- "Insufficient client scope" — Delete the
.cachefile and re-authenticate
P.S. If something goes wrong — I’m not responsible for it. The license says so, and the whole thing was written by an AI.