lyrics: fix a bug where the lyricswiki fetcher would try to unescape an empty (None) response and crash

This commit is contained in:
wordofglass 2016-04-29 23:50:03 +02:00
parent 078a0702d3
commit 1dd6739218

View file

@ -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"<div class='lyricbox'>")
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):