Skip to content

fix: Support new Spotify API response format (track -> item)#2628

Open
BillionClaw wants to merge 1 commit intospotDL:devfrom
BillionClaw:clawoss/fix/spotify-api-update
Open

fix: Support new Spotify API response format (track -> item)#2628
BillionClaw wants to merge 1 commit intospotDL:devfrom
BillionClaw:clawoss/fix/spotify-api-update

Conversation

@BillionClaw
Copy link

Description

Spotify updated their Web API in February 2026 (changelog), changing the playlist items response structure from using a track key to an item key.

This PR updates spotDL to handle both the old and new API response formats for backward compatibility.

Changes

  • spotdl/types/playlist.py: Updated to handle both track and item keys when extracting track metadata from playlist items
  • spotdl/types/saved.py: Same update for saved tracks

Testing

The fix has been tested to ensure it works with both:

  • Old API format: {"track": {...}}
  • New API format: {"item": {...}}

Related Issue

Fixes #2621

Spotify updated their API in February 2026, changing the playlist items
response structure from 'track' to 'item'. This fix ensures compatibility
with both old and new API formats.

Changes:
- spotdl/types/playlist.py: Handle both 'track' and 'item' keys
- spotdl/types/saved.py: Handle both 'track' and 'item' keys

Fixes spotDL#2621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant