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

Can't save json if there's no album name #125

Closed pybix closed 4 years ago

pybix commented 4 years ago

save_lyrics gives an error when there's a song without an album title

x = api.search_artist("eminem", max_songs=10) x.save_lyrics(format = 'json', filename = "eminem")

I always get this error when executing the code above: TypeError: 'NoneType' object is not subscriptable

I am a novice with python so I'm not sure if I'm maybe doing something wrong.

I'm using Python 3.7.3 with Jupyter.

johnwmillr commented 4 years ago

Hi there,

I don't get the same NoneType error you're describing. What version of the lyricsgenius package are you using? The current version of the package doesn't use the format parameter with the save_lyrics method.

Try updating to the latest version of the package and see if that resolves the issue.

John

pybix commented 4 years ago

Thanks for the response!

I updated the package and it works now, I didn't even realize I wasn't on the latest version. Thanks!!

johnwmillr commented 4 years ago

Glad to hear it!