-
Notifications
You must be signed in to change notification settings - Fork 55
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
IndexError: list index out of range #277
Comments
Please include the full command you are trying to run.
I think there is minimal error handling for books that might not have the format epub2tts expects. If you can share the source material that causes this it will help diagnose the problem. |
I thought I matched the chapter break formatting correctly. Was generally running something like epub2tts mybook.txt Happy to share the txt file privately. I was using https://github.com/isaac-mcfadyen/rr-to-epub then Changing the chapter titles to start with # epub2tts-edge worked much more reliably I also note that it errored out on a chapter that did not exist: The last chapter in this book was # Chapter 37, but the script tries to access chapter 38. |
I'm having the same issue, its not the source material as I tested a book that I already had done previously File "/home/moderatec/miniconda/envs/epub/bin/epub2tts", line 8, in
|
I'm unable to reproduce. It seems like it thinks there are more chapters than exist, but I've tried adding in empty chapters like so:
and that worked fine. I was able to trigger a different bug by adding in a line that only has If anyone can send source material that reliably breaks this I can poke at it. My email is xxx. |
I have a feeling I might know what is going on here. The format of an input text file is very specific at the beginning. It will check the first two lines for Author or Title. Following that (or if there is no Author/Title specified), the next section MUST start with a chapter marker ( The format needs to be like:
|
I am pretty sure this error is from lacking chapter marker, pushed up a branch that bails if it's missing. |
I tested this on other material I had done previously and the same thing is happening. for context I had installed VoxNovel on a separate Env but it somehow messed with epub2tts I reinstalled epub2tts and that's when this bug started so I don't think it's the source material causing the issue. |
Can you share the exact command you are calling epub2tts with? If the source material is a text file, can you share the first 5 lines of the file? If it's an epub, is epub2tts able to successfully export it to text? |
I've now run into this issue a few times, not sure what I'm doing wrong.
Using WSL Ubuntu 24 in a python virtual environment as suggested.
Part: 38 Traceback (most recent call last): File "/mnt/c/temp/epub2tts/.venv/bin/epub2tts", line 8, in <module> sys.exit(main()) ^^^^^^ File "/mnt/c/temp/epub2tts/.venv/lib/python3.12/site-packages/epub2tts.py", line 1165, in main mybook.get_chapters_text( File "/mnt/c/temp/epub2tts/.venv/lib/python3.12/site-packages/epub2tts.py", line 664, in get_chapters_text print(f"{self.section_names[i]}") ~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range
The text was updated successfully, but these errors were encountered: