update API endpoints for Feb 2026 Dev Mode changes and more#9
Open
soyware wants to merge 2 commits into
Open
Conversation
add Saved Albums, Followed Artists, and Podcast support; update .gitignore; retrieve canonical User ID;
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.
Overview
This Pull Request updates
spotify-playlists.pyto adapt to the Spotify Developer Access and Platform Security changes announced in February 2026. Legacy/deprecated routes that have been removed are replaced with their modern counterparts, response field parsing is aligned with renamed structures, and robustness is improved to prevent crashes during batch operations.In addition, this PR expands the utility of the script by adding full export and import support for Saved Albums, Followed Artists, and Podcasts (Shows & Saved Episodes).
The code was enhanced using Google® Gemini® service, quickly glanced over and tested with followed podcasts, saved podcast episodes, own playlist and liked tracks.
Detailed Changes
1. Compatibility with February 2026 Web API Changes
sp.user_playlist_createwith the recommendedsp.current_user_playlist_create(uses POST/me/playlistsunder the hood, as POST/users/{user_id}/playlistswas completely removed).sp.user_playlist_change_detailsin favor of settingcollaborativedirectly during playlist creation.sp.user_playlist_add_trackswithsp.playlist_add_items(uses the updated POST/playlists/{id}/itemsroute instead of the removed/tracksendpoint).process_tracksto parse both"item"(new Web API rules) and"track"(legacy/saved tracks fallback) keys:track = item.get("item") or item.get("track").sp.playlist_itemsfromitems(track(...))toitems(item(...))to match the renamed playlist response fields.is_owneroris_collaborative) before callingsp.playlist_items.try...except spotipy.SpotifyExceptionblock. If there's an issue fetching a specific playlist, the script logs a warning and proceeds with the rest of the export rather than crashing.2. Saved Albums, Followed Artists, and Podcasts Support (Export/Import)
"user-library-modify","user-follow-read", and"user-follow-modify"to authorization scopes.sp.current_user_saved_albums()and written toSaved albums.xspf(type:"saved_albums").sp.current_user_followed_artists()and written toFollowed artists.xspf(type:"followed_artists").sp.current_user_saved_shows()and written toFollowed podcasts.xspf(type:"followed_podcasts").sp.current_user_saved_episodes()and written toLiked podcasts.xspf(type:"liked_podcasts").<type>element from the XML<extension>tag."saved_tracks"->sp.current_user_saved_tracks_add()"saved_albums"->sp.current_user_saved_albums_add()"followed_artists"->sp.user_follow_artists()"followed_podcasts"->sp.current_user_saved_shows_add()"liked_podcasts"->sp.current_user_saved_episodes_add()3. Platform Encoding Fixes
encoding="utf-8"explicitly inwrite_playlist()to preventUnicodeEncodeErrorwhen dealing with tracks containing UTF-8 characters on Windows platforms.References
Update on Developer Access and Platform Security
February 2026 Web API Dev Mode Changes - Migration Guide