johnwmillr / LyricsGenius

Download song lyrics and metadata from Genius.com 🎶🎤
http://www.johnwmillr.com/scraping-genius-lyrics/
MIT License
915 stars 161 forks source link

Character not recognized #86

Closed rau closed 5 years ago

rau commented 5 years ago

Describe the bug When I try to scrape lyrics of the top 10 popular Kanye songs, it doesn't recognize one character.

Expected behavior return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u0150' in position 2716: character maps to <undefined>

This error will pop up, and I think this means it encountered the character u0150.

To Reproduce Describe the steps required to reproduce the behavior.

`if scrape_mode is True: artist = genius.search_artist("Kanye West", max_songs=10, sort="popularity") lyrics = ''

for i in range(10):
    with open('Kanye.txt', 'a') as file:
        file.write(artist.songs[i].lyrics)`

Include the error message associated with the bug.

Version info

Additional context Add any other context about the problem here.

johnwmillr commented 5 years ago

I don't actually get this same encoding error when trying the code you provided. I am using Python 3.6.5 and lyricsgenius version 1.3.0. Can you provide additional information on your platform, package, and Python version? It would also help to have a more complete picture of the code you're running.

johnwmillr commented 5 years ago

Closing due to inactivity. Feel free to reopen if you're still running into issues.