feat(deezer): support downloading liked tracks from user profile URLs#986
Closed
berettavexee wants to merge 1 commit into
Closed
feat(deezer): support downloading liked tracks from user profile URLs#986berettavexee wants to merge 1 commit into
berettavexee wants to merge 1 commit into
Conversation
Add support for Deezer profile/loved URLs of the form: https://www.deezer.com/{lang}/profile/{user_id}/loved - parse_url.py: new DeezerFavoriteURL class matching the profile/loved pattern - deezer.py: get_playlist() routes "favorites:{user_id}" IDs to a new get_user_favorites() method; workaround for deezer-py dropping the limit argument when routing get_user_tracks() to get_my_favorite_tracks() - cli.py: document supported URL formats in `rip url --help` - README.md: add feature bullet and usage example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Superseded by #987 which includes the same feature along with a bug fix (gw.get_track blocking the event loop), a perf improvement (cached user ID), and a refactor (named constant for the favorites limit). |
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.
Summary
https://www.deezer.com/{lang}/profile/{user_id}/lovedDeezerFavoriteURLclass inparse_url.pymatches the pattern and creates aPendingPlaylistwith a syntheticfavorites:{user_id}IDget_playlist()inDeezerClientroutes that synthetic ID to a newget_user_favorites()methodget_user_favorites()works around a bug indeezer-pywhereget_user_tracks()silently drops thelimitargument when routing toget_my_favorite_tracks(), by detecting the logged-in user and callingget_my_favorite_tracks()directly with the correct limit (up to 2000 tracks for public profiles, up to 10 000 for own profile viasong.getFavoriteIds)Usage
Test plan
DeezerFavoriteURLwith correct user IDPlaylistMetadata.from_deezer()is compatible with the response format fromget_user_favorites()get_my_favorite_tracks()(full library)get_user_profile_page()(up to 2000 tracks)