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

--combine works for mp3, but if --output-format m4b is used in addition, only the first chapter is saved #29

Open
catfordfire opened this issue Feb 16, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@catfordfire
Copy link

sorrrrrrry.....

No script errors occur, but the resulting m4b file is only (I think) the first chapter of the book. The conversion from mp3 to m4b works fine for the individual chapters, but the --combine flag seems to confuse something. to clarify - this all works perfectly now without the --output-format flag.

@jo1gi
Copy link
Owner

jo1gi commented Feb 16, 2023

It's because the library I use for adding chapters does not support m4b files. It should work with mp3 files, also if you use --combine.

@catfordfire
Copy link
Author

hi - thanks. makes sense.

@jo1gi
Copy link
Owner

jo1gi commented Feb 16, 2023

I have made a temporary fix. It just requires ffmpeg. Please tell me if you have any problems.

@catfordfire
Copy link
Author

Hi - it didn't work for me, unfortunately. It converted all to m4b and then combined to a file of only the first chapter.

@jo1gi
Copy link
Owner

jo1gi commented Feb 16, 2023

I tried again. Hope it works now.

@jo1gi jo1gi added the bug Something isn't working label Feb 16, 2023
@catfordfire
Copy link
Author

sadly not :( this is what I see. Could it be something on my end?

Converting files
Combining files
Adding chapters
Traceback (most recent call last):
File "/opt/homebrew/bin/audiobook-dl", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.4.3', 'console_scripts', 'audiobook-dl')())
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/main.py", line 56, in run
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/main.py", line 77, in run_on_url
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/download.py", line 47, in download
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/download.py", line 152, in combined_audiobook
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/download.py", line 160, in embed_metadata_in_file
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/metadata/init.py", line 31, in add_chapters
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/metadata/ffmpeg.py", line 35, in add_chapters_ffmpeg
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/metadata/ffmpeg.py", line 22, in create_tmp_chapter_file
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/metadata/ffmpeg.py", line 10, in create_chapter_text
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/utils/init.py", line 23, in read_asset_file
File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/zipfile.py", line 2362, in read_text
with self.open('r', *args, **kwargs) as strm:
File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/zipfile.py", line 2342, in open
raise FileNotFoundError(self)
FileNotFoundError: /opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/assets/ffmpeg_chapter_template.txt

@jo1gi
Copy link
Owner

jo1gi commented Feb 17, 2023

Could it be something on my end?

I think it is. It looks like there is a file it can't find. Maybe try uninstalling and installing it again? You could also try running it directly with python -m audiobookdl [options] <url>.

@catfordfire
Copy link
Author

thanks. I'll look into it. I tried the direct command, but different error. I think I'll stick to auto-m4b for now, as that's working well on a docker. Thanks so much for trying to resolve this for me! Hope it helps other people :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants