Skip to content

fix(deezer): fall back to GW API for non-public playlists on PermissionException - #1048

Open
boomesh11 wants to merge 1 commit into
nathom:devfrom
boomesh11:fix/deezer-private-playlist-gw-fallback
Open

boomesh11 wants to merge 1 commit into
nathom:devfrom
boomesh11:fix/deezer-private-playlist-gw-fallback

Conversation

@boomesh11

Copy link
Copy Markdown

Fixes #1046.

Problem

DeezerClient.get_playlist() only queried Deezer's public API (self.client.api.get_playlist / get_playlist_tracks). When authenticated via ARL without an OAuth �ccess_token, non-public playlists raise deezer.errors.PermissionException (OAuthException code 200).

Fix

  • Caught deezer.errors.PermissionException in DeezerClient.get_playlist() (streamrip/client/deezer.py) and fell back to self.client.gw.get_playlist_page / self.client.gw.get_playlist_tracks, normalizing the returned title and track ids for PlaylistMetadata.from_deezer().

Verification

  • Added ests/test_deezer_private_playlist.py verifying the GW fallback and PlaylistMetadata.from_deezer() parsing.
  • Ran pytest tests/test_deezer_private_playlist.py: 1 passed.

@Stensel8

Copy link
Copy Markdown

Already fixed in my fork in fee2070 :)

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.

[BUG] Deezer: non-public playlists fail with PermissionException (code 200) — fallback to GW proposed

2 participants