diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 0ada97e8b..55e0fe2ed 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -171,11 +171,16 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): :return: JSON data for the class:`Response ` object. :rtype: dict """ - response = request_type( - url, - headers={'Authorization': f'Bearer {self.access_token}'}, - params=params, - ) + try: + response = request_type( + url, + headers={'Authorization': f'Bearer {self.access_token}'}, + params=params, + ) + response.raise_for_status() + except requests.exceptions.ReadTimeout: + self._log.debug('ReadTimeout. Retrying.') + return self._handle_response(request_type, url, params=params) if response.status_code != 200: if 'token expired' in response.text: self._log.debug(