From dfc1aa20b3edbb4bd6d8a69d5ce1d2a3c0aece0e Mon Sep 17 00:00:00 2001 From: Fabrice Laporte Date: Sun, 21 Dec 2014 14:35:16 +0100 Subject: [PATCH 1/2] lyrics: musixmatch, disable https verification --- beetsplug/lyrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index e778ad950..50761ed6f 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -61,7 +61,7 @@ def fetch_url(url): is unreachable. """ try: - r = requests.get(url) + r = requests.get(url, verify=False) except requests.RequestException as exc: log.debug(u'lyrics request failed: {0}'.format(exc)) return From 802d1521ed294c12aba89e953988970aea8e173c Mon Sep 17 00:00:00 2001 From: Fabrice Laporte Date: Sun, 21 Dec 2014 14:38:19 +0100 Subject: [PATCH 2/2] lyrics: don't throw when extraction fails --- beetsplug/lyrics.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index 50761ed6f..448399fe0 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -85,8 +85,11 @@ def unescape(text): def extract_text_between(html, start_marker, end_marker): - _, html = html.split(start_marker, 1) - html, _ = html.split(end_marker, 1) + try: + _, html = html.split(start_marker, 1) + html, _ = html.split(end_marker, 1) + except ValueError: + return u'' return _scrape_strip_cruft(html, True)