bhrigu123 / Instant-Lyrics

Shows lyrics of the currently playing Spotify song, or any song, instantly.
http://bhrigu.me/Instant-Lyrics/
195 stars 33 forks source link

Problems with encoding utf-8 #8

Open schcriher opened 7 years ago

schcriher commented 7 years ago

The contribution of Nico264 1 is interesting. One way to solve only the encoding problem is to edit the line 37 of the lyrics.py file: replace "text" with "content", according to the requests documentation 3, for utf-8 it works perfect.

Ref:

schcriher commented 7 years ago

A possible better way:

lyrics_html = requests.get(link, headers=HEADERS)
lyrics_html.encoding = html.apparent_encoding
soup = BeautifulSoup(lyrics_html.text, "lxml")
diniremix commented 7 years ago

I have the same issue Imgur

update: fix issue using @schcriher fix, thanks! Imgur