From 18e5b30d19dbd3a10e1dabf27a9f795b0be9fe09 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 31 Dec 2015 11:29:57 -0800 Subject: [PATCH] acousticbrainz: Handle requests errors --- beetsplug/acousticbrainz.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/beetsplug/acousticbrainz.py b/beetsplug/acousticbrainz.py index 65a8f7d71..9c0c18260 100644 --- a/beetsplug/acousticbrainz.py +++ b/beetsplug/acousticbrainz.py @@ -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: