Fix/track fallback resolution#81
Open
themmm wants to merge 2 commits into
Open
Conversation
Deezer's song.getListData and radio.getUserRadio APIs sometimes return tracks with an empty RIGHTS hash (STATUS=3), meaning the primary track version cannot be streamed on the user's account or region. In these cases the API also provides a FALLBACK object pointing to an alternative version that is fully licensed. Before this fix the plugin passed the primary track token to the media provider and received error 2002 "Track token has no sufficient rights on requested media", causing the track to be silently skipped. Now both getTrackUrl and flowTracks check RIGHTS before using a track token and switch to the FALLBACK version when rights are absent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deezer explicitly provides a FALLBACK entry in the API response when a track cannot be streamed, pointing to a licensed alternative version. The comment now makes clear that FALLBACK is Deezers own suggestion, not a workaround. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Disclaimer:
All code-changes have been made with Claude-code.
Problem
Some tracks returned by
song.getListData(andradio.getUserRadio)have an empty
RIGHTShash, meaning the primary track version is notlicensed for streaming on the user's account or region. Attempting to
play such a track resulted in error 2002 from the media provider:
The track was then silently skipped.
Root cause
The plugin passed the primary track's
TRACK_TOKENandSNG_IDdirectly to
_getProviderswithout checking whether the track actuallyhas streaming rights.
Solution
When Deezer cannot serve a track, it includes a
FALLBACKobject in theAPI response. This is Deezer's own recommendation: an alternative version
of the same song (different
SNG_ID/TRACK_TOKEN) with populatedRIGHTSthat can be streamed. The fix checksRIGHTSfor each track andtransparently substitutes the
FALLBACKwhere needed.Applied to both
getTrackUrl(on-demand playback) andflowTracks(Flow / radio mode).
Testing
where
FILESIZE_FLAC = 0andRIGHTS = {}in the gateway response).