Add API for getting user favorites and playlists

This commit is contained in:
François Charette 2020-12-05 21:49:52 +01:00
parent 902c5b8ee2
commit 6444a31590

View File

@ -156,6 +156,18 @@ class Client:
def search_tracks(self, query, limit):
return self.api_call("track/search", query=query, limit=limit)
def get_favorite_albums(self, offset, limit):
return self.api_call("favorite/getUserFavorites", type="albums", offset=offset, limit=limit)
def get_favorite_tracks(self, offset, limit):
return self.api_call("favorite/getUserFavorites", type="tracks", offset=offset, limit=limit)
def get_favorite_artists(self, offset, limit):
return self.api_call("favorite/getUserFavorites", type="artists", offset=offset, limit=limit)
def get_user_playlists(self, limit):
return self.api_call("playlist/getUserPlaylists", limit=limit)
def test_secret(self, sec):
try:
r = self.api_call("userLibrary/getAlbumsList", sec=sec)