Change error handling

This commit is contained in:
Alok Saboo 2023-04-28 18:02:17 -04:00
parent 731015b6d5
commit 067a3633d3

View file

@ -902,14 +902,12 @@ class Spotify(RemoteArtSource):
SPOTIFY_ALBUM_URL = 'https://open.spotify.com/album/'
def get(self, album, plugin, paths):
if not len(album.mb_albumid) == 22 and \
not album.data_source == 'Spotify':
return
url = self.SPOTIFY_ALBUM_URL + album.mb_albumid
try:
response = requests.get(url)
except requests.RequestException:
self._log.debug('Spotify: error receiving response')
response.raise_for_status()
except requests.exceptions.HTTPError as e:
self._log.debug("Error: " + str(e))
return
try:
html = response.text