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

Spotify plugin crashes often #4685

Closed
2V3EvG4LMJFdRe opened this issue Feb 28, 2023 · 3 comments · Fixed by #4686
Closed

Spotify plugin crashes often #4685

2V3EvG4LMJFdRe opened this issue Feb 28, 2023 · 3 comments · Fixed by #4686
Labels

Comments

@2V3EvG4LMJFdRe
Copy link

Problem

Bunch of results online all over the place for this one, seems to be a problem with their API

beet import [whatever]

Led to this problem:

  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/beet", line 33, in <module>
    sys.exit(load_entry_point('beets==1.6.1', 'console_scripts', 'beet')())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/ui/__init__.py", line 1304, in main
    _raw_main(args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/ui/__init__.py", line 1291, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/ui/commands.py", line 1034, in import_func
    import_files(lib, paths, query)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/ui/commands.py", line 974, in import_files
    session.run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/importer.py", line 340, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/util/pipeline.py", line 446, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/util/pipeline.py", line 311, in run
    out = self.coro.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/util/pipeline.py", line 193, in coro
    func(*(args + (task,)))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/importer.py", line 1395, in lookup_candidates
    task.lookup_candidates()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/importer.py", line 661, in lookup_candidates
    autotag.tag_album(self.items, search_ids=self.search_ids)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/autotag/match.py", line 461, in tag_album
    for matched_candidate in hooks.album_candidates(items,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/plugins.py", line 573, in decorated
    for v in generator(*args, **kwargs):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/autotag/hooks.py", line 632, in album_candidates
    yield from plugins.candidates(items, artist, album, va_likely, extra_tags)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/plugins.py", line 384, in candidates
    yield from plugin.candidates(items, artist, album, va_likely,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/plugins.py", line 733, in candidates
    albums = [self.album_for_id(album_id=r['id']) for r in results]
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beets/plugins.py", line 733, in <listcomp>
    albums = [self.album_for_id(album_id=r['id']) for r in results]
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beetsplug/spotify.py", line 260, in album_for_id
    track = self._get_track(track_data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/beetsplug/spotify.py", line 300, in _get_track
    album = track_data['album']['name']
TypeError: 'NoneType' object is not subscriptable

Setup

  • OS: macOS High Sierra
  • Python version: 3.9.5
  • beets version: 1.6.1
  • Turning off plugins made problem go away (yes/no): turning off Spotify plugin
@arsaboo
Copy link
Contributor

arsaboo commented Feb 28, 2023

@2V3EvG4LMJFdRe Created a PR that fixed the error for me. Let us hope someone can merge this one soon..

@2V3EvG4LMJFdRe
Copy link
Author

Similar? With the lyrics plugin using genius.

The action “Run Shell Script” encountered an error: “Traceback (most recent call last):
  File "/usr/local/bin/beet", line 10, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/Library/Python/2.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Library/Python/2.7/site-packages/beets/ui/commands.py", line 955, in import_func
    import_files(lib, paths, query)
  File "/Library/Python/2.7/site-packages/beets/ui/commands.py", line 925, in import_files
    session.run()
  File "/Library/Python/2.7/site-packages/beets/importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/Library/Python/2.7/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/Library/Python/2.7/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/Library/Python/2.7/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/Library/Python/2.7/site-packages/beets/importer.py", line 1511, in plugin_stage
    func(session, task)
  File "/Library/Python/2.7/site-packages/beets/plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 827, in imported
    False, self.config['force'])
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 840, in fetch_item_lyrics
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 873, in get_lyrics
    lyrics = backend.fetch(artist, title)
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 403, in fetch
    return self.lyrics_from_song_api_path(song_api_path)
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 375, in lyrics_from_song_api_path
    lyrics = html.find("div", class_="lyrics").get_text()
AttributeError: 'NoneType' object has no attribute 'get_text'
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 10, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/Library/Python/2.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 747, in func
    opts.force_refetch or self.config['force'],
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 840, in fetch_item_lyrics
    lyrics = [self.get_lyrics(artist, title) for title in titles]
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 873, in get_lyrics
    lyrics = backend.fetch(artist, title)
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 403, in fetch
    return self.lyrics_from_song_api_path(song_api_path)
  File "/Library/Python/2.7/site-packages/beetsplug/lyrics.py", line 375, in lyrics_from_song_api_path
    lyrics = html.find("div", class_="lyrics").get_text()
AttributeError: 'NoneType' object has no attribute 'get_text'”

@arsaboo
Copy link
Contributor

arsaboo commented Feb 28, 2023

@2V3EvG4LMJFdRe I don't use the lyrics feature, so cannot say for sure. Why don't you create a separate issue with this error with details...thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants