Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lyrics plugin error "object of type 'NoneType' has no len()" #3970

Closed
2V3EvG4LMJFdRe opened this issue Jun 4, 2021 · 3 comments · Fixed by #3978
Closed

Lyrics plugin error "object of type 'NoneType' has no len()" #3970

2V3EvG4LMJFdRe opened this issue Jun 4, 2021 · 3 comments · Fixed by #3978
Labels
bug bugs that are confirmed and actionable

Comments

@2V3EvG4LMJFdRe
Copy link

2V3EvG4LMJFdRe commented Jun 4, 2021

Problem

beet lyrics was left running for a while, worked fine until it stopped at some unidentified song that triggered:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/ui/__init__.py", line 1291, in main
    _raw_main(args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/ui/__init__.py", line 1278, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beetsplug/lyrics.py", line 792, in func
    opts.force_refetch or self.config['force'],
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beetsplug/lyrics.py", line 889, in fetch_item_lyrics
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beetsplug/lyrics.py", line 889, in <listcomp>
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beetsplug/lyrics.py", line 922, in get_lyrics
    lyrics = backend.fetch(artist, title)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beetsplug/lyrics.py", line 347, in fetch
    self.fetch_url(hit["result"]["url"]))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beetsplug/lyrics.py", line 376, in _scrape_lyrics_from_html
    html = BeautifulSoup(html, "html.parser")
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bs4/__init__.py", line 310, in __init__
    elif len(markup) <= 256 and (
TypeError: object of type 'NoneType' has no len()

Setup

  • OS: macOS High Sierra
  • Python version: 3.7
  • beets version: 1.5.0

Relevant issue: #479

@2V3EvG4LMJFdRe
Copy link
Author

2V3EvG4LMJFdRe commented Jun 15, 2021

No one else has this? Should I run some version so that it doesn't happen?

lyrics:
    auto: yes
    force: yes
    sources: genius musixmatch lyricwiki google
    google_API_key: redacted
    fallback: ''
    import.write: yes

@wisp3rwind
Copy link
Member

No, this seems to be an actual bug, the fix from #480 apparently either got lost or didn't apply to all lyrics sources in the first place. I'll have a try at fixing this.

This probably didn't show up before because it only manifests when the lyrics provider's server is unreachable. If your connection is down entirely, that would show up much quicker.

@wisp3rwind wisp3rwind added the bug bugs that are confirmed and actionable label Jun 15, 2021
@2V3EvG4LMJFdRe
Copy link
Author

Thanks a lot, hopefully you can get it. I could have posted the verbose log, but I'm going through my music year by year and the error shows up a solid hour into the process or so. Sometimes it doesn't show up at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants