Quote:
Originally Posted by Shane45666
Keep getting this error when trying to edit a re-zipped EPUB, or open the unzipped folder to edit.
calibre, version 8.4.0
Traceback (most recent call last):
File "calibre\gui2\tweak_book\job.py", line 33, in run
File "calibre\gui2\tweak_book\boss.py", line 101, in get_container
File "calibre\ebooks\oeb\polish\container.py", line 1637, in get_container
File "calibre\ebooks\oeb\polish\container.py", line 1226, in __init__
calibre.ebooks.oeb.polish.container.InvalidEpub: META-INF/container.xml contains no link to OPF file
There is an OPF file, and a META-INF file, and the container.xml seems to have a link to the OPF file
XML File
<?xml version="1.0" encoding="UTF-8"?><container xmlns="urn  asis:names:tc  pendocument:xmlns:conta iner" version="1.0">
<rootfiles xmlns="">
<rootfile full-path="OPS/package.opf" media-type="application/oebps-package+xml"/>
</rootfiles>
</container>
How to fix?
|
Opening the unzipped ePub to attempt to edit it will only work if you use Sigil with it's Folder In/Folder Out plugin. An ePub has a very specific structure.
Going by the spec, the mimetype file must be in the root of the archive and not compressed. The container.xml file must be in the META-INF directory. The other files can be in the root of the .zip container or in subdirectories. However the container.xml has the path to the .opf file. In your case, the package.ofp file must in the OPS directory which must be in the root of the .zip container.
I've attached some images from opening an ePub file using 7-Zip (first is the root of the .zip container then the contents of the OEBPS directory and then the container.xml file open in an editor.
If you manually re-zip an unzipped ePub, you will need to add the mimetype file uncompressed first and then the remainder of the files in the same directory structure as the original ePub since that structure will be used for all the paths.
Please do
not tell us just where you got an ePub as an unzipped file.