Expected str instance nonetype found
See original GitHub issueMy code
from lyricsgenius import Genius
genius = Genius(xxx)
genius.remove_section_headers = True
artist = genius.search_artist(xxx)
artist.save_lyrics(extension = 'txt', binary_encoding=True)
Sometimes script can’t find lyrics to one song, passes it and goes to another one. But when saving file, it gives this error:
Error at line XX: Expected str instance nonetype found genius lyrics
How do I fix this error so I’m able to save the lyrics, even if one or more is missing?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
TypeError: sequence item 0: expected string, NoneType found
Within these lines, you've used a join statement multiple times. The join statement requires a list of strings in order to work. However,...
Read more >TypeError: sequence item 1: expected string, NoneType found ...
I think this error is coming from utils._import_asnames and occurs because one of the import statements is not using as (e.g. import theano ......
Read more >DNS config error "sequence item 0: expected str instance ...
I am using root@ubuntu:/snap/maas/current# snap list Name Version Rev Tracking Publisher Notes core18 20220428 2409 latest/stable ...
Read more >TypeError: sequence item 0: expected string, NoneType found
i have no idea why this error is popping up i have'nt edited anything in those files can anyone explain me please!
Read more >libinput-replay exception "TypeError: sequence item 0 ...
libinput-replay exception "TypeError: sequence item 0: expected str instance, NoneType found" · Summary · Fix · Steps to reproduce · Required ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This particular issue happens because we’re making a lot of requests and as you mentioned their API wasn’t made for lyrics, so we have to download each song page separately. This causes the number of requests to rise and time-outs are bound to happen when we make so many HTTP requests. In your case, the timeout happens when the package tries to fetch the full song info (because the
get_full_info
parameter isTrue
), but at the same time, the package doesn’t handle the timeouts as it should. But all that is handled in the next version that’s coming out.You shouldn’t change the max_songs parameter as we’re adding the songs manually, so all we need is an empty Artist object. I edited the script above and improved it a bit.