mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 09:33:46 +01:00
fetchart: Handle errors when parsing malformed JSON from google
This commit is contained in:
parent
2e10b8c284
commit
be64df6409
1 changed files with 6 additions and 1 deletions
|
|
@ -176,7 +176,12 @@ class GoogleImages(ArtSource):
|
|||
})
|
||||
|
||||
# Get results using JSON.
|
||||
data = response.json()
|
||||
try:
|
||||
data = response.json()
|
||||
except ValueError:
|
||||
self._log.debug(u'google: error loading response: {}'.format(response.text))
|
||||
return
|
||||
|
||||
if 'error' in data:
|
||||
reason = data['error']['errors'][0]['reason']
|
||||
self._log.debug(u'google fetchart error: {0}', reason)
|
||||
|
|
|
|||
Loading…
Reference in a new issue