Quote:
Originally Posted by Mick2nd
- epub toc at different location than expected
|
Looking at the code, you are assuming the NCX file is called "toc.ncx" and will either be in the OEPBS or root directory of the book. I have plenty of books where this would fail. You should be finding the file using the OPF.
Alternatively, calibre has methods to do this. Look at:
Code:
from calibre.ebooks.oeb.polish.container import EpubContainer
from calibre.ebooks.oeb.polish.toc import get_toc
Open the book using the first, and get the ToC using the latter. Or look at them to see how to find the appropriate file.