def get_artists_albums(self, id=None, **kwargs): """Get Spotify catalog information about an artist's albums. Optional parameters can be specified in the query string to filter and sort the response.""" url = '/artists/{id}/albums'.format(id=id) res = self._request('GET', url, **kwargs) return models.Paging(**res)
def get_playlists_tracks(self, user_id=None, playlist_id=None, **kwargs): """Get full details of the tracks of a playlist owned by a Spotify user.""" url = '/users/{user_id}/playlists/{playlist_id}/tracks'.format( user_id=user_id, playlist_id=playlist_id) res = self._request('GET', url, **kwargs) return models.Paging(headers=self.headers, **res)
def get_albums_tracks(self, id=None, **kwargs): """Get Spotify catalog information about an album's tracks. Optional parameters can be used to limit the number of tracks returned.""" url = '/albums/{id}/tracks'.format(id=id) res = self._request('GET', url, **kwargs) return models.Paging(**res)
def get_list_featured_playlists(self, **kwargs): """Get a list of Spotify featured playlists (shown, for example, on a Spotify player's "Browse" tab).""" url = '/browse/featured-playlists' res = self._request('GET', url, **kwargs) return { 'message': res.get('message'), 'playlists': models.Paging(**res['playlists']), }
def search_item(self, type=None, **kwargs): """Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string.""" url = '/search?type={type}'.format(type=type) res = self._request('GET', url, **kwargs) # The response object returns plural representations of the # object type (e.g. albums, artists, etc.) plural_type = '{type}s'.format(type=type) return models.Paging(**res[plural_type])
def get_list_new_releases(self, **kwargs): """Get a list of new album releases featured in Spotify (shown, for example, on a Spotify player's "Browse" tab).""" url = '/browse/new-releases' res = self._request('GET', url, **kwargs) return { 'message': res.get('message'), 'albums': models.Paging(**res['albums']), }
def get_list_users_playlists(self, user_id=None, **kwargs): """Get a list of the playlists owned or followed by a Spotify user.""" url = '/users/{user_id}/playlists'.format(user_id=user_id) res = self._request('GET', url, **kwargs) return models.Paging(headers=self.headers, **res)
def get_categorys_playlists(self, id=None, **kwargs): """Get a list of Spotify playlists tagged with a particular category.""" url = '/browse/categories/{id}/playlists'.format(id=id) res = self._request('GET', url, **kwargs) return models.Paging(**res['playlists'])
def get_list_categories(self, **kwargs): """Get a list of categories used to tag items in Spotify (on, for example, the Spotify player's "Browse" tab).""" url = '/browse/categories' res = self._request('GET', url, **kwargs) return models.Paging(**res['categories'])