audiobook-dl icon indicating copy to clipboard operation
audiobook-dl copied to clipboard

Python throws an error

Open joshaconnor opened this issue 1 year ago • 2 comments

This isn't exactly a bug, as the files downloaded as far as I can tell, but here is the output of the command which seems to show an error. I am not sure what it is, and I don't have time to debug too much at the moment, but I thought I would let you know in case it is helpful for you.

I downloaded a book from Chirp, if that helps.

Converting files
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/audiobook-dl", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/__main__.py", line 56, in run
    run_on_url(options, url)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/__main__.py", line 77, in run_on_url
    download(s, options)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/output/download.py", line 50, in download
    add_metadata_to_dir(source, filenames, output_dir)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/output/download.py", line 173, in add_metadata_to_dir
    metadata.add_metadata(filename, source.metadata())
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/output/metadata/__init__.py", line 9, in add_metadata
    id3.add_id3_metadata(filepath, metadata)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/output/metadata/id3.py", line 34, in add_id3_metadata
    audio = MP3(filepath, ID3=EasyID3)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/_file.py", line 47, in __init__
    self.load(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/_util.py", line 155, in wrapper
    return func(self, h, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/id3/_file.py", line 420, in load
    self.info = self._Info(fileobj, offset)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/_util.py", line 184, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/mp3/__init__.py", line 401, in __init__
    raise HeaderNotFoundError("can't sync to MPEG frame")
mutagen.mp3.HeaderNotFoundError: can't sync to MPEG frame

joshaconnor avatar Apr 05 '23 05:04 joshaconnor

Looks like Chirp doesn't always use mp3 files which breaks some stuff when adding metadata to the files afterwards. I will see what I can do about it.

jo1gi avatar Apr 06 '23 21:04 jo1gi

Interesting, the resulting files were mp3, I wonder if VLC is just interpreting the internals of the file instead of the file extension. But I do notice that the cover image isn't present in those folders, that could also be part of it.


Josh Connor (they/them) joshaconnor.com

On Thu, Apr 6, 2023, 17:10 Joakim Holm @.***> wrote:

Looks like Chirp doesn't always use mp3 files which breaks some stuff when adding metadata to the files afterwards. I will see what I can do about it.

— Reply to this email directly, view it on GitHub https://github.com/jo1gi/audiobook-dl/issues/35#issuecomment-1499635397, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF3LQGEOMCTGVJMFFKI7EWDW74WMDANCNFSM6AAAAAAWTS3FSA . You are receiving this because you authored the thread.Message ID: @.***>

joshaconnor avatar Apr 06 '23 21:04 joshaconnor