From 83e42efa88be2008cd8e8a358a076f93ddae3a7a Mon Sep 17 00:00:00 2001 From: eugenio412 Date: Fri, 8 Apr 2016 17:12:31 +0200 Subject: [PATCH] include refresh_access_token method to the library in this way it's possible to refresh token even if it's not cached but saved somewhere else --- 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'}