From d1753b341eefe33e925e0e5a3618ede53efef455 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 21 Mar 2016 10:28:30 -0700 Subject: [PATCH] lyrics: Some comments and better naming --- beetsplug/lyrics.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index 7ed64d88d..207b9d084 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -331,8 +331,12 @@ class LyricsWiki(SymbolsReplaced): html = self.fetch_url(url) if not html: return - lyrics = extract_text_in(unescape(html), u"
") - 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"
") + lyrics = scrape_lyrics_from_html(html_frag) + if lyrics and 'Unfortunately, we are not licensed' not in lyrics: return lyrics