p0n1 / epub_to_audiobook

EPUB to audiobook converter, optimized for Audiobookshelf
MIT License
1.04k stars 107 forks source link

Could we add a --no-prompt option to supress the prompt (Do you want to continue? (y/n)) #35

Closed haydonryan closed 8 months ago

haydonryan commented 8 months ago

Hi there, Great work here! I'm working on a project where I would be running this in a pipeline, so no text input is possible. Could we add a --no-prompt option?.

2024-01-13 13:34:10 [INFO] Chapters count: 33.
2024-01-13 13:34:10 [INFO] Converting chapters from 1 to 33.
2024-01-13 13:34:10 [INFO] ✨ Total characters in selected book: 554126 ✨
Estimate book voiceover would cost you roughly: $8.88
Do you want to continue? (y/n)

Another minor suggestion here- if you pass the --preview option idea here, it still asks you to confirm if you would like to continue. If you're just previewing ... it won't actually do the conversion - so can we skip the prompt, just process and exit?

Thanks! and have a great day.

p0n1 commented 8 months ago

Hi. Thanks for great and reasonable suggestions. I think it's reasonable to have these changes. Will address them later.

haydonryan commented 8 months ago

Thankyou! And thank you for an excellent tool!

haydonryan commented 8 months ago

I can try snd submit a PR too. Are there any tests that would be needed for this?

p0n1 commented 8 months ago

I can try snd submit a PR too. Are there any tests that would be needed for this?

Here are some simple tests https://github.com/p0n1/epub_to_audiobook/tree/main/tests. However, the parts that actually involve external API interactions still lack test cases. If you are willing to submit a PR, I would be happy to review and test it.

p0n1 commented 8 months ago

Just released in https://github.com/p0n1/epub_to_audiobook/releases/tag/v0.5.1.

haydonryan commented 8 months ago

Awesome thank you!