From 1dd6739218e8725dfed405166abe964611768b2b Mon Sep 17 00:00:00 2001 From: wordofglass Date: Fri, 29 Apr 2016 23:50:03 +0200 Subject: [PATCH] lyrics: fix a bug where the lyricswiki fetcher would try to unescape an empty (None) response and crash --- beetsplug/lyrics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index b55fac9a7..b6936e1be 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -347,10 +347,11 @@ class LyricsWiki(SymbolsReplaced): # Get the HTML fragment inside the appropriate HTML element and then # extract the text from it. html_frag = extract_text_in(html, u"
") - lyrics = _scrape_strip_cruft(html_frag, True) + if html_frag: + lyrics = _scrape_strip_cruft(html_frag, True) - if lyrics and 'Unfortunately, we are not licensed' not in lyrics: - return lyrics + if lyrics and 'Unfortunately, we are not licensed' not in lyrics: + return lyrics class LyricsCom(Backend):