Comments (3)
Thanks for pointing this out! Are you using Python 2 or 3? The solution you've suggested works well for me for Python 3 but throws a UnicodeEncodeError
in Python 2. From my understanding, Python 3 does a much better job of handling Unicode text than Python 2.
My .encode('ascii','ignore').decode('ascii')
line is basically a kludge to try and deal with these UnicodeEncodeError
errors; I hadn't encountered this issue for a while, but here's proof that my solution is inadequate.
Do you want to put together a pull request addressing this issue? I'd be happy to merge your changes if you're able to solve the issue for both Python 2 and 3. Otherwise I'll try to get to the issue once I have time.
John
EDIT: I see your PR now.
from lyricsgenius.
@johnwmillr I'm using Python 3 and I did not even think about Python 2. Hmm...
from lyricsgenius.
Right, your solution is good for Python 3, but 2 is a pain... Maybe I need to think about whether it's worth supporting 2 much longer. It may make sense to allow Python 2 to just throw an error on the UnicodeEncodeError
and let the Python 2 user deal with it as they like (as I mentioned in my comment on your PR).
from lyricsgenius.
Related Issues (20)
- Is this library abandoned completely? HOT 5
- All download/progress lost, when crashing while running the genius.search_artist()-Function. HOT 1
- Feature request: add a path option to the genius.save_lyrics()-function HOT 2
- Request timed out during API call for songs of an artist
- Doc clarification search_artist vs artist_songs HOT 1
- Lyrics returned is buggy and includes ads? HOT 4
- how to get the genre of a song? HOT 2
- Reduce Verbosity HOT 1
- Add option to get metadata of desired track HOT 9
- Doesn't return any matching songs HOT 2
- Regex for excluded_terms HOT 1
- Enforce rate limiting HOT 1
- R.E.M. returns Changing artist name to 'Don Toliver' HOT 2
- Lyrics have unwanted data returned with them HOT 1
- genius.lyrics is returning unwanted data in requests
- Lyrics search returns random page
- Total error [Errno 403] 403 Client Error: Forbidden for url HOT 3
- Tests failing HOT 3
- Step by step setup with "403 Client Error" HOT 3
- Genre query early stopping
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lyricsgenius.