enricobacis / lyricwikia

Python API to get song lyrics from LyricWikia
MIT License
39 stars 12 forks source link

Doesn't Support Unicode Characters in song lyrics. #1

Closed ndragon798 closed 6 years ago

ndragon798 commented 7 years ago

I Don’t Wanna Live Forever (Fifty Shades Darker) ZAYN & Taylor Swift

Traceback (most recent call last):
  File "lyricgrab.py", line 8, in <module>
    print(lyricwikia.get_lyrics("'"+artistnames[0]+"'","'"+songnames[0]+"'"))
  File "/usr/local/lib/python2.7/dist-packages/lyricwikia/lyricwikia.py", line 15, in get_lyrics
    url = create_url(artist, song)
  File "/usr/local/lib/python2.7/dist-packages/lyricwikia/lyricwikia.py", line 11, in create_url
    song='_'.join(song.title().split()))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 6: ordinal not in range(128)
enricobacis commented 7 years ago

Could you please post a minimal example of code that raises the error?