johnwmillr / LyricsGenius

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

Getting null values for majority of the downloaded song lyrics #143

Closed erkutkaya closed 4 years ago

erkutkaya commented 4 years ago

Hi all!

When I try to download the lyrics for an artist, I get NULL values for the lyrics for a big portion of the downloaded songs. E.g. the code below gives me the lyrics for one or two of the songs and NULL for the rest (E.g. artist.songs[0] is NULL and artist.song[1] contains the song lyrics). Note the results differ for each run. The code is provided below:

api = genius.Genius(geniusCreds, remove_section_headers=True, excluded_terms=['(Remix)', '(Live)'])
artist = api.search_artist("Drake", max_songs=4)

I have been looking around but cant seem to find a solution for this. Any suggestions?

allerter commented 4 years ago

Possible Duplicate of #139

erkutkaya commented 4 years ago

Thank you for the response!

All you have to do is to replace lines 169 to 174 with the code below:

I have read through the thread and I guess it comes down to replacing the code you mentioned there under the quote above. However, where and how to replace the code?

allerter commented 4 years ago

Go to the directory where the LyricsGenius package is saved on your PC (hint: pip show lyricsgenius) and replace those lines in the api.py file

erkutkaya commented 4 years ago

Thank you, the fix solved the problem. Much appreciated!