lyrics: detect missing lyrics in lyrics.com result

This commit is contained in:
Adrian Sampson 2012-03-10 12:40:19 +00:00
parent c65b237b99
commit 3ffbe171e5

View file

@ -115,7 +115,7 @@ def fetch_lyricscom(artist, title):
html = urllib.urlopen(url).read()
lyrics = extract_text(html, '<div id="lyric_space">')
if lyrics:
if lyrics and 'Sorry, we do not have the lyric' not in lyrics:
parts = lyrics.split('\n---\nLyrics powered by', 1)
if parts:
return parts[0]