Since Spotify's Feb 2026 Web API migration, playlist responses wrap each entry in item instead of track (tracks.track → items.item), and track is now marked deprecated.
PlaylistTrack still requires track, so get_playlist and get_playlist_items fail on the new payload:
MissingField: Field "track" of type Item is missing in PlaylistTrack instance
→ InvalidFieldValue: Field "items" of type list[PlaylistTrack] in PlaylistTracks ...
→ InvalidFieldValue: Field "items" of type PlaylistTracks in Playlist ...
Reproduced on spotifyaio==2.0.2: feeding a real playlist-items response (entries with item and no track) to Playlist.from_json / PlaylistTracks raises the above; adding track = item makes it parse.
This is currently breaking the Home Assistant Spotify integration (home-assistant/core#165877).
track is still sent during the deprecation window, so both shapes need to work. I think the cleanest fix is normalizing item → track in PlaylistTrack.__pre_deserialize__, mirroring what Playlist.__pre_deserialize__ already does for tracks → items. Happy to open a PR.
Related: #767 handles a missing items list (metadata-only playlists) but not the track/item rename.
Since Spotify's Feb 2026 Web API migration, playlist responses wrap each entry in
iteminstead oftrack(tracks.track→items.item), andtrackis now marked deprecated.PlaylistTrackstill requirestrack, soget_playlistandget_playlist_itemsfail on the new payload:Reproduced on
spotifyaio==2.0.2: feeding a real playlist-items response (entries withitemand notrack) toPlaylist.from_json/PlaylistTracksraises the above; addingtrack = itemmakes it parse.This is currently breaking the Home Assistant Spotify integration (home-assistant/core#165877).
trackis still sent during the deprecation window, so both shapes need to work. I think the cleanest fix is normalizingitem→trackinPlaylistTrack.__pre_deserialize__, mirroring whatPlaylist.__pre_deserialize__already does fortracks→items. Happy to open a PR.Related: #767 handles a missing
itemslist (metadata-only playlists) but not thetrack/itemrename.