mirror of
https://github.com/beetbox/beets.git
synced 2026-01-20 07:02:39 +01:00
Added extra checking to fetchart plugin.
Will avoid a KeyError being raised when Content-Type header is missing. See #664.
This commit is contained in:
parent
9c00e43b30
commit
bf05135e5f
1 changed files with 2 additions and 1 deletions
|
|
@ -47,7 +47,8 @@ def _fetch_image(url):
|
|||
log.debug(u'fetchart: downloading art: {0}'.format(url))
|
||||
try:
|
||||
with closing(requests_session.get(url, stream=True)) as resp:
|
||||
if not resp.headers['Content-Type'] in CONTENT_TYPES:
|
||||
if not 'Content-Type' in resp.headers \
|
||||
or not resp.headers['Content-Type'] in CONTENT_TYPES:
|
||||
log.debug(u'fetchart: not an image')
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue