jo1gi / audiobook-dl

Audiobook CLI downloader
GNU General Public License v3.0
253 stars 43 forks source link

Storytel ID3 issue when downloading #74

Closed yratof closed 11 months ago

yratof commented 12 months ago

Downloading this book:

https://www.storytel.com/is/books/harry-potter-og-viskusteinninn-312257

creates this issue:

Traceback (most recent call last):
  File "/opt/homebrew/bin/audiobook-dl", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/__main__.py", line 32, in main
    process_url(url, options, config)
  File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/__main__.py", line 58, in process_url
    process_audiobook(result, options)
  File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/__main__.py", line 163, in process_audiobook
    download(audiobook, options)
  File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/output/download.py", line 37, in download
    download_audiobook(audiobook, output_dir, options)
  File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/output/download.py", line 61, in download_audiobook
    add_metadata_to_file(audiobook, filepaths[0], options)
  File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/output/download.py", line 77, in add_metadata_to_file
    metadata.add_chapters(filepath, audiobook.chapters)
  File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/output/metadata/__init__.py", line 31, in add_chapters
    id3.add_id3_chapters(filepath, chapters)
  File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/output/metadata/id3.py", line 69, in add_id3_chapters
    audio = ID3(filepath)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/id3/_file.py", line 77, in __init__
    super(ID3, self).__init__(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/id3/_tags.py", line 173, in __init__
    super(ID3Tags, self).__init__(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/_util.py", line 534, in __init__
    super(DictProxy, self).__init__(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/_tags.py", line 111, in __init__
    self.load(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/_util.py", line 185, in wrapper
    return func(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/_util.py", line 156, in wrapper
    return func(self, h, *args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/id3/_file.py", line 152, in load
    self._header = ID3Header(fileobj)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/_util.py", line 185, in wrapper
    return func(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/mutagen/id3/_tags.py", line 67, in __init__
    raise ID3NoHeaderError("%r doesn't start with an ID3 tag" % fn)
mutagen.id3._util.ID3NoHeaderError: 'Harry Potter og viskusteinninn-J.K. Rowling.mp3' doesn't start with an ID3 tag

Not sure if it's the name or the length, but no meta gets downloaded. no chapters, no covers etc.

jo1gi commented 11 months ago

I got it working in 1c89e3adef3f744bf9b669a22677a313c0270eea. It's available on Github.

freddy36 commented 11 months ago

I can confirm that it's fixed with the commit