diff --git a/spotify.py b/spotify.py index 0fdeba4..5fae002 100644 --- a/spotify.py +++ b/spotify.py @@ -5,8 +5,7 @@ import requests import spotipy -from ovos_backend_client.api import OAuthApi -from ovos_utils.oauth import OAuthTokenDatabase, OAuthApplicationDatabase +from ovos_utils.oauth import OAuthTokenDatabase, OAuthApplicationDatabase, get_oauth_token from ovos_utils.log import LOG from ovos_utils.parse import match_one, fuzzy_match, MatchStrategy from ovos_utils.xdg_utils import xdg_config_home @@ -47,8 +46,7 @@ def is_token_expired(token_info: dict): @staticmethod def get_access_token(): - t = OAuthApi().get_oauth_token(OAUTH_TOKEN_ID, - auto_refresh=True) + t = get_oauth_token(OAUTH_TOKEN_ID, auto_refresh=True) # TODO auto_refresh flag not working if OVOSSpotifyCredentials.is_token_expired(t): LOG.warning("SPOTIFY TOKEN EXPIRED")