mirror of
https://github.com/rembo10/headphones.git
synced 2026-04-19 11:29:29 +01:00
Lyrics module now handles non-ascii chars
This commit is contained in:
@@ -7,8 +7,8 @@ from headphones import logger
|
||||
|
||||
def getLyrics(artist, song):
|
||||
|
||||
params = { "artist": artist,
|
||||
"song": song,
|
||||
params = { "artist": artist.encode('utf-8'),
|
||||
"song": song.encode('utf-8'),
|
||||
"fmt": 'xml'
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ def getLyrics(artist, song):
|
||||
m = re.compile('''<div class='lyricbox'><div class='rtMatcher'>.*?</div>(.*?)<!--''').search(lyricspage)
|
||||
|
||||
if not m:
|
||||
logger.warn('Cannot find lyrics on: %s' % lyricsurl)
|
||||
logger.warn('Cannot find lyrics on: %s (might be instrumental)' % lyricsurl)
|
||||
return
|
||||
|
||||
lyrics = convert_html_entities(m.group(1)).replace('<br />', '\n')
|
||||
|
||||
Reference in New Issue
Block a user