mirror of
https://github.com/c0de-archive/spotipy.git
synced 2025-01-08 15:42:48 +00:00
Update oauth2.py
refresh access token is now available also for developers, not only for the library
This commit is contained in:
parent
0b9a0276c1
commit
891731c78e
@ -134,7 +134,7 @@ class SpotifyOAuth(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
if self._is_token_expired(token_info):
|
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:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
@ -221,7 +221,7 @@ class SpotifyOAuth(object):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _refresh_access_token(self, refresh_token):
|
def refresh_access_token(self, refresh_token):
|
||||||
payload = { 'refresh_token': refresh_token,
|
payload = { 'refresh_token': refresh_token,
|
||||||
'grant_type': 'refresh_token'}
|
'grant_type': 'refresh_token'}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user