Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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']),
     }
Example #5
0
 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])
Example #6
0
 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']),
     }
Example #7
0
 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)
Example #8
0
 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'])
Example #9
0
 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'])