lyrics: Some comments and better naming

This commit is contained in:
Adrian Sampson 2016-03-21 10:28:30 -07:00
parent f684f29a25
commit d1753b341e

View file

@ -331,8 +331,12 @@ class LyricsWiki(SymbolsReplaced):
html = self.fetch_url(url)
if not html:
return
lyrics = extract_text_in(unescape(html), u"<div class='lyricbox'>")
lyrics = scrape_lyrics_from_html(lyrics)
# Get the HTML fragment inside the appropriate HTML element and then
# extract the text from it.
html_frag = extract_text_in(unescape(html), u"<div class='lyricbox'>")
lyrics = scrape_lyrics_from_html(html_frag)
if lyrics and 'Unfortunately, we are not licensed' not in lyrics:
return lyrics