Neurrone / beets-audible

Organize Your Audiobook Collection With Beets
MIT License
113 stars 19 forks source link

Error when trying to embedart in M4B #60

Open SenorSmartyPants opened 6 months ago

SenorSmartyPants commented 6 months ago

I have an M4B that I already matched/tagged with beets-audible and now I want to embed the art that is being fetched. I turned on embedart plugin and added this to my config

embedart:
    auto: yes
    remove_art_file: yes

I'm not understanding the traceback so I thought you might understand it better. Here's the output from import -vvvv

$ beet -vvvv -c /config/config-audiobook.yaml import -I .
overlaying configuration: /config/config-audiobook.yaml
user configuration: /config/config.yaml
data directory: /config
plugin paths:
inline: adding item field track_and_title
inline: adding item field multidisc
inline: adding item field multidiscDIR
inline: adding album field narrator
inline: adding album field series
Sending event: pluginload
library database: /config/audiobooklibrary.blb
library directory: /storage/media/Audiobook.bak
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
Sending event: import_task_start
Looking up: /storage/media/Audiobook.bak/Blake Crouch/Recursion
Tagging Blake Crouch - Recursion
No album ID found.
Search terms: Blake Crouch - Recursion
Album might be VA: False
audible: Searching Audible for Recursion Blake Crouch
audible: Excluded 1 books which have not been released from consideration.
audible: search Goodreads again based on author/title.
audible: 6 results found
audible: Goodreads match found #42046112 - Blake Crouch Recursion
audible: search Goodreads again based on author/title.
audible: 6 results found
audible: Goodreads match found #42046112 - Blake Crouch Recursion
audible: search Goodreads again based on author/title.
audible: 6 results found
audible: 1 results found
audible: Goodreads match found #56759189 - Salim Lemelle Refresh
audible: Matching album name recursion with book title recursion
audible: Attempting to match book: album Recursion with 1 files to book Recursion with 8 chapters.
audible: Matching album name recursion with book title recursion
audible: Attempting to match book: album Recursion with 1 files to book Recursion with 51 chapters.
audible: Matching album name recursion with book title recursión
audible: Matching album name recursion with book title refresh
Sending event: albuminfo_received
Candidate: Blake Crouch - Recursion (1984886878)
Computing track assignment...
...done.
Success. Distance: 0.00
Sending event: albuminfo_received
Candidate: Blake Crouch - Recursion (1509866701)
Computing track assignment...
...done.
Success. Distance: 0.06
Sending event: albuminfo_received
Candidate: Blake Crouch - Recursión (B09JGDHD9K)
Computing track assignment...
...done.
Success. Distance: 0.79
Sending event: albuminfo_received
Candidate: Salim Lemelle - Refresh (B08QDTC63C)
Computing track assignment...
...done.
Success. Distance: 0.62
Evaluating 4 candidates.

/storage/media/Audiobook.bak/Blake Crouch/Recursion (1 items)
Sending event: import_task_before_choice
Sending event: before_choose_candidate

  Match (100.0%):
  Blake Crouch - Recursion
  Audible, None, 2019, None, Random House Audio, 1984886878, None
  * Artist: Blake Crouch
  * Album: Recursion
Sending event: import_task_choice
Sending event: import_task_apply
Replacing item 714: /storage/media/Audiobook.bak/Blake Crouch/Recursion/Recursion.m4b
Sending event: database_change
Sending event: database_change
Sending event: album_removed
Sending event: item_removed
1 of 1 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Reimported album 34. Preserving attribute ['added']. Path: /storage/media/Audiobook.bak/Blake Crouch/Recursion
Reimported album 34. Preserving flexible attributes ['data_source']. Path: /storage/media/Audiobook.bak/Blake Crouch/Recursion
Reimported item 714. Preserving attribute ['added']. Path: /storage/media/Audiobook.bak/Blake Crouch/Recursion/Recursion.m4b
Reimported item 714. Preserving flexible attributes ['album_sort', 'subtitle', 'itunes_media_type', 'data_source', 'cover_url', 'summary_html', 'desc', 'is_chapter_data_accurate']. Path: /storage/media/Audiobook.bak/Blake Crouch/Recursion/Recursion.m4b
Sending event: database_change
audible: downloaded art to: /tmp/tmpkw0563my.jpg
Parsed query: AndQuery([SubstringQuery('albumtype', 'audiobook', fast=True), RegexpQuery('series_name', re.compile('.+'), fast=False), RegexpQuery('series_position', re.compile('.+'), fast=False)])
Parsed sort: NullSort()
Parsed query: AndQuery([SubstringQuery('albumtype', 'audiobook', fast=True), RegexpQuery('series_name', re.compile('.+'), fast=False)])
Parsed sort: NullSort()
Parsed query: AndQuery([SubstringQuery('albumtype', 'audiobook', fast=True)])
Parsed sort: NullSort()
Sending event: before_item_moved
importadded: Recorded mtime 1715033750.1250408 for item '/storage/media/Audiobook.bak/Blake Crouch/Recursion/Recursion.m4b' imported from '/storage/media/Audiobook.bak/Blake Crouch/Recursion/Recursion.m4b'
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
importadded: Write of item '/storage/media/Audiobook.bak/Blake Crouch/Recursion/Recursion.m4b', selected item.added=1714978691.3073022
Sending event: database_change
Sending event: import_task_files
scrub: auto-scrubbing /storage/media/Audiobook.bak/Blake Crouch/Recursion/Recursion.m4b
scrub: writing new tags after scrub
Sending event: write
Sending event: after_write
importadded: Write of item '/storage/media/Audiobook.bak/Blake Crouch/Recursion/Recursion.m4b', selected item.added=1714978691.3073022
scrub: restoring art
Sending event: art_set
permissions: setting file permissions on /storage/media/Audiobook.bak/Blake Crouch/Recursion/cover.jpg
embedart: Embedding album art into Blake Crouch - Recursion
embedart: embedding /storage/media/Audiobook.bak/Blake Crouch/Recursion/cover.jpg
Sending event: write
Traceback (most recent call last):
  File "/lsiopy/bin/beet", line 33, in <module>
    sys.exit(load_entry_point('beets==1.6.1', 'console_scripts', 'beet')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/beets/ui/__init__.py", line 1865, in main
    _raw_main(args)
  File "/lsiopy/lib/python3.11/site-packages/beets/ui/__init__.py", line 1852, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/lsiopy/lib/python3.11/site-packages/beets/ui/commands.py", line 1395, in import_func
    import_files(lib, paths, query)
  File "/lsiopy/lib/python3.11/site-packages/beets/ui/commands.py", line 1326, in import_files
    session.run()
  File "/lsiopy/lib/python3.11/site-packages/beets/importer.py", line 360, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/lsiopy/lib/python3.11/site-packages/beets/util/pipeline.py", line 447, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/lsiopy/lib/python3.11/site-packages/beets/util/pipeline.py", line 359, in run
    self.coro.send(msg)
  File "/lsiopy/lib/python3.11/site-packages/beets/util/pipeline.py", line 171, in coro
    task = func(*(args + (task,)))
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/beets/importer.py", line 1692, in manipulate_files
    task.manipulate_files(
  File "/lsiopy/lib/python3.11/site-packages/beets/importer.py", line 810, in manipulate_files
    plugins.send("import_task_files", session=session, task=self)
  File "/lsiopy/lib/python3.11/site-packages/beets/plugins.py", line 507, in send
    result = handler(**arguments)
             ^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/beets/plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/beetsplug/audible.py", line 486, in on_import_task_files
    task.album.set_art(cover_path, True)
  File "/lsiopy/lib/python3.11/site-packages/beets/library.py", line 1454, in set_art
    plugins.send("art_set", album=self)
  File "/lsiopy/lib/python3.11/site-packages/beets/plugins.py", line 507, in send
    result = handler(**arguments)
             ^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/beets/plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/beetsplug/embedart.py", line 261, in process_album
    art.embed_album(
  File "/lsiopy/lib/python3.11/site-packages/beets/art.py", line 129, in embed_album
    embed_item(
  File "/lsiopy/lib/python3.11/site-packages/beets/art.py", line 99, in embed_item
    item.try_write(path=itempath, tags={"images": [image]}, id3v23=id3v23)
  File "/lsiopy/lib/python3.11/site-packages/beets/library.py", line 860, in try_write
    self.write(*args, **kwargs)
  File "/lsiopy/lib/python3.11/site-packages/beets/library.py", line 833, in write
    plugins.send("write", item=self, path=path, tags=item_tags)
  File "/lsiopy/lib/python3.11/site-packages/beets/plugins.py", line 507, in send
    result = handler(**arguments)
             ^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/beets/plugins.py", line 134, in wrapper
    assert self._log.level == logging.NOTSET
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
SenorSmartyPants commented 6 months ago

Doing a manual beet -vvvv -c /config/config-audiobook.yaml embedart -f cover.jpg Blake Crouch Recursion completes with no errors and updates the art (I checked with picard and mp3tag)