mirror of
https://github.com/beetbox/beets.git
synced 2026-01-26 10:02:31 +01:00
acousticbrainz: Handle requests errors
This commit is contained in:
parent
eb2b081dfd
commit
18e5b30d19
1 changed files with 7 additions and 1 deletions
|
|
@ -48,10 +48,16 @@ def fetch_info(log, lib):
|
|||
if item.mb_trackid:
|
||||
log.info('getting data for: {}', item)
|
||||
|
||||
# Fetch the data from the AB API.
|
||||
url = generate_url(item.mb_trackid)
|
||||
log.debug('fetching URL: {}', url)
|
||||
rs = requests.get(url)
|
||||
try:
|
||||
rs = requests.get(url)
|
||||
except requests.RequestException as exc:
|
||||
log.info('request error: {}', exc)
|
||||
continue
|
||||
|
||||
# Parse the JSON response.
|
||||
try:
|
||||
rs.json()
|
||||
except ValueError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue