Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with encoding utf-8 #8

Open
schcriher opened this issue Jul 27, 2017 · 2 comments
Open

Problems with encoding utf-8 #8

schcriher opened this issue Jul 27, 2017 · 2 comments

Comments

@schcriher
Copy link

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:
[1]: #5
[2]: https://github.com/bhrigu123/Instant-Lyrics/blob/master/src/lyrics.py#L37
[3]: http://docs.python-requests.org/en/master/user/quickstart/#response-content

@schcriher
Copy link
Author

A possible better way:

lyrics_html = requests.get(link, headers=HEADERS)
lyrics_html.encoding = html.apparent_encoding
soup = BeautifulSoup(lyrics_html.text, "lxml")

@diniremix
Copy link

diniremix commented Aug 20, 2017

I have the same issue Imgur

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants