From 9d88a68d50bb5a76ebd747e11734428d49112f03 Mon Sep 17 00:00:00 2001 From: HES SONG Date: Fri, 28 Sep 2018 14:50:41 +0900 Subject: [PATCH] Update client.py (add playlist endpoint) There was an upate with Spotify Web APi to bring playlist with using ID. --- spotipy/client.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spotipy/client.py b/spotipy/client.py index 90b87b7..a64a5fc 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -387,6 +387,20 @@ class Spotify(object): plid = self._get_id('playlist', playlist_id) return self._get("users/%s/playlists/%s" % (user, plid), fields=fields) + def playlist(self, playlist_id, fields=None, market=None): + """ Gets playlist by id + + Parameters: + - playlist - the id of the playlist + - fields - which fields to return + - market - An ISO 3166-1 alpha-2 country code or the string from_token. + """ + + plid = self._get_id('playlist', playlist_id) + + return self._get("playlists/%s" % (plid), fields=fields) + + def user_playlist_tracks(self, user, playlist_id=None, fields=None, limit=100, offset=0, market=None): """ Get full details of the tracks of a playlist owned by a user.