From 0b9a0276c1edd3c9de478021b8b8daba4dbba4b0 Mon Sep 17 00:00:00 2001 From: eugenio412 Date: Fri, 10 Jun 2016 13:33:45 +0200 Subject: [PATCH 1/3] Update client.py added available market on search and search now is also for artist by default --- spotipy/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotipy/client.py b/spotipy/client.py index be9162b..966fb94 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -310,7 +310,7 @@ class Spotify(object): tlist = [self._get_id('album', a) for a in albums] return self._get('albums/?ids=' + ','.join(tlist)) - def search(self, q, limit=10, offset=0, type='track'): + def search(self, q, limit=10, offset=0, type='track,artist',market='US'): ''' searches for an item Parameters: @@ -320,7 +320,7 @@ class Spotify(object): - type - the type of item to return. One of 'artist', 'album', 'track' or 'playlist' ''' - return self._get('search', q=q, limit=limit, offset=offset, type=type) + return self._get('search', q=q, limit=limit, offset=offset, type=type,market=market) def user(self, user): ''' Gets basic profile information about a Spotify User From 891731c78e472e3cd30cc7167c691d9876783e73 Mon Sep 17 00:00:00 2001 From: eugenio412 Date: Fri, 10 Jun 2016 13:36:14 +0200 Subject: [PATCH 2/3] Update oauth2.py refresh access token is now available also for developers, not only for the library --- spotipy/oauth2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index bb10e32..4ed635c 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -134,7 +134,7 @@ class SpotifyOAuth(object): return None if self._is_token_expired(token_info): - token_info = self._refresh_access_token(token_info['refresh_token']) + token_info = self.refresh_access_token(token_info['refresh_token']) except IOError: pass @@ -221,7 +221,7 @@ class SpotifyOAuth(object): else: return None - def _refresh_access_token(self, refresh_token): + def refresh_access_token(self, refresh_token): payload = { 'refresh_token': refresh_token, 'grant_type': 'refresh_token'} From c9888f16bc91dc2aeddd175b25a5237b8f31eba1 Mon Sep 17 00:00:00 2001 From: eugenio412 Date: Sat, 11 Jun 2016 13:32:15 +0200 Subject: [PATCH 3/3] Update client.py it wasnt working before, now it is --- spotipy/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotipy/client.py b/spotipy/client.py index 966fb94..be9162b 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -310,7 +310,7 @@ class Spotify(object): tlist = [self._get_id('album', a) for a in albums] return self._get('albums/?ids=' + ','.join(tlist)) - def search(self, q, limit=10, offset=0, type='track,artist',market='US'): + def search(self, q, limit=10, offset=0, type='track'): ''' searches for an item Parameters: @@ -320,7 +320,7 @@ class Spotify(object): - type - the type of item to return. One of 'artist', 'album', 'track' or 'playlist' ''' - return self._get('search', q=q, limit=limit, offset=offset, type=type,market=market) + return self._get('search', q=q, limit=limit, offset=offset, type=type) def user(self, user): ''' Gets basic profile information about a Spotify User