From ff7b0f3e2a42fb7c3db050d0461d567aae5e2222 Mon Sep 17 00:00:00 2001 From: Luke Woloszyn Date: Wed, 27 Jul 2016 08:10:45 -0700 Subject: [PATCH] get new access token ~60 seconds before old one times out --- spotipy/oauth2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index bb10e32..abab767 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -78,7 +78,7 @@ class SpotifyClientCredentials(object): def _is_token_expired(self, token_info): now = int(time.time()) - return token_info['expires_at'] < now + return token_info['expires_at'] - now < 60 def _add_custom_values_to_token_info(self, token_info): """