mirror of
https://github.com/beetbox/beets.git
synced 2025-12-26 02:24:33 +01:00
Change error handling
This commit is contained in:
parent
731015b6d5
commit
067a3633d3
1 changed files with 3 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue