From d87e3e6628c78193fa7719882bbfaa0755c24fee Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Mon, 9 Oct 2023 08:59:15 -0400 Subject: [PATCH] Update error code --- beetsplug/spotify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 9ad87a13e..b5a46714d 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -187,7 +187,7 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): retries += 1 time.sleep(1) except requests.exceptions.RequestException as e: - if 'token expired' in str(e): + if e.response.status_code == 401: self._log.debug( f'{self.data_source} access token has expired.' f' Reauthenticating.'