Fix deprecated Spotify Web API endpoints - #48
Open
maxliving wants to merge 1 commit into
Open
Conversation
Spotify deprecated several playlist endpoints in late 2024. This updates
the affected calls to use the current API surface.
Changes:
- create_playlist: POST /users/{id}/playlists → POST /me/playlists
- add_tracks_to_playlist: POST /playlists/{id}/tracks → POST /playlists/{id}/items
- remove_tracks_from_playlist: DELETE /playlists/{id}/tracks → DELETE /playlists/{id}/items
- get_playlist_tracks: switched from sp.playlist()['tracks'] to GET /playlists/{id}/items directly
- parse_playlist/parse_tracks: handle renamed response key ('track' → 'item') and
missing 'tracks' object in create response
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spotify deprecated several playlist-related endpoints in late 2024, replacing
/trackswith/itemsacross the playlist API. This PR updates all affected calls.create_playlist:POST /users/{user_id}/playlists→POST /me/playlistsadd_tracks_to_playlist:POST /playlists/{id}/tracks→POST /playlists/{id}/itemsremove_tracks_from_playlist:DELETE /playlists/{id}/tracks→DELETE /playlists/{id}/itemsget_playlist_tracks: replacedsp.playlist()['tracks']with a direct call toGET /playlists/{id}/itemsparse_playlist/parse_tracks: handle the renamed response key (track→item) in playlist item objects, and gracefully handle the missingtracksobject in create responsesTest plan
Tested end-to-end against the live Spotify API.
🤖 Generated with Claude Code