fix: handle Spotify February 2026 API breaking changes for playlist i…#2636
Open
dksheets wants to merge 3 commits intospotDL:masterfrom
Open
fix: handle Spotify February 2026 API breaking changes for playlist i…#2636dksheets wants to merge 3 commits intospotDL:masterfrom
dksheets wants to merge 3 commits intospotDL:masterfrom
Conversation
|
This seems straightforward - anything we can do to help get this merged? |
Author
|
There's actually one other small change I need to make to avoid errors related to embedding track metadata with ffmpeg- I will get that up today. @Crateros I'm not sure, I'm new here 🤷 |
Use .get() for popularity to avoid KeyError when the field is absent in the updated Spotify API response.
Author
|
All changes are now included and should be ready to merge with approval |
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.
Description
Fixes six breaking changes introduced by Spotify's February 2026 API update that prevent spotDL from downloading playlists and individual tracks.
playlist.py
iteminstead oftrackas the key for track metadata. Updated parsing to check foritemfirst, falling back totrackfor backward compatibility.song.py
genresfield was removed from album and artist metadata responses. Updated to use.get()with empty list fallback instead of direct key access..get()instead of direct key access.popularityfield was removed from track metadata responses, causing aKeyError: 'popularity'on every track. Updated to use.get("popularity")instead of direct key access.popularityfield used for embedded metadata was still using direct key access, causing a crash when writing track metadata. Updated to use.get()for compatibility.album.py
.get()instead of direct key access.Related Issue
Spotify February 2026 API changelog: https://developer.spotify.com/documentation/web-api/references/changes/february-2026
Motivation and Context
track.get("track")now returnsNonefor every itemKeyError: 'genres'since the field no longer exists in album/artist responsesKeyError: 'popularity'when the field is missing from the API responseHow Has This Been Tested?
item) and legacy (track) API response formatsgenresfieldsScreenshots (if appropriate)
N/A
Types of Changes
Checklist