Fix warning on non-200 status codes in coverart
This commit is contained in:
parent
3c17d2bf28
commit
2806f64a1a
|
@ -85,7 +85,11 @@ class CoverDownloader(object):
|
|||
|
||||
try:
|
||||
logger.info('Downloading cover art: %s', cover_url)
|
||||
data = util.urlopen(cover_url, timeout=self.TIMEOUT).content
|
||||
response = util.urlopen(cover_url, timeout=self.TIMEOUT)
|
||||
if response.status_code != 200:
|
||||
msg = '%s returned status code %d' % (cover_url, response.status_code)
|
||||
raise ValueError(msg)
|
||||
data = response.content
|
||||
except Exception as e:
|
||||
logger.warn('Cover art download failed: %s', e)
|
||||
return self._fallback_filename(title)
|
||||
|
|
Loading…
Reference in New Issue