1

I have an epub file which weighs 5.4 MB, and I looked at the files inside using Calibre's "Edit Ebook" feature.

I noticed the following weird thing: among the files inside the ebook are two .epub files.

View of nested files within ebook

Screenshot of Calibre's file browser revealing two hidden epub files nested inside the ebook

This is the first time that I've been faced with an epub inside an epub.

These two extra epub files inside the ebook appear to be completely different books, by other authors and unrelated to the first book. When I run Calibre's "Check book for bugs", the two extra epub are flagged with the following warnings:

The file OEBPS/Misc/Alice_Kellen_-23_automnes_avant_toi__Te_retrouver.epub has its MIME type specified as text/plain in the OPF file. The recommended MIME type for files with the extension "epub" is application/epub+zip. You should change either the file extension or the MIME type in the OPF.

It looks like Calibre is confused by the presence of an epub file inside another epub file and doesn't know what to do with it.

The two nested epub files weigh 0.7 MB and 4.2 MB respectively, so in particular the second one appears to be singlehandedly responsible for most of the overall weight.

I'm guessing my best course of action would be to extract these two epub files and add them to Calibre Library separately, so that I'd have three ebooks in total, rather than one ebook which contains two hidden nested .epub files.

What is the easiest way to extract these two epub files? I have two goals here:

  • Making the original ebook lighter by removing these two "stowaway" files from it;
  • Being able to read these two new ebooks in case I might find them interesting.

1 Answer 1

2

Both of the stowaway epubs are probably also linked inside the OPF file and/or NCX file to the existing Epub you are now viewing and will need de-linked somehow (either automatically with EpubSplit plugin, or manually by viewing the code in Calibre editor). Try initially by using the Calibre EpubSplit plugin tool to extract those epubs. Here are several links that should help get you there.
Epubor link

ESE link

Since I mentioned 'manual method' here it is as well (so others reading this forum can choose which direction to process it). Using 7-zip software (or similar utility tool) open that software to its main section. At top left is a list of options (file, edit, etc). Click on: View > 2 panels. In the right panel go to the epub and change the extension to .zip extension. Double click to get inside of it and drag both the stowaway epubs over into the left panel (that should be in your 'Documents' or similar folder zone). Then delete both stowaway epubs (from your primary epub). Then change that primary epub from .zip back to .epub extension. After all that ... you might want to open it in Calibre to verify that the epub will function properly (as it may need to have some of the OPF / NCX files updated/altered (which can be done in Calibre).

Welcome to ESE.

3
  • Thank you! I assume "delete this file" followed by "automatically fix all fixable bugs" in the Calibre editor is an appropriate way to de-link them?
    – Stef
    Oct 1, 2023 at 17:24
  • After careful inspection it looks like these two stowaway epubs are present in several ebooks in my collection, I don't know if this is due to a wrong manipulation that I would have made or if I've received them this way (these are ebooks that I haven't read yet but that I've had for several years). So now I'm inspecting all ebooks in my collection that are approximately 5MB.
    – Stef
    Oct 1, 2023 at 17:24
  • Yes remove extra stowaways using Calibre editor, or via a manual method (using 7zip software or similar tool). Calibre editor > right click > 'delete selected' stowaway epubs entire folder. Use the 'revert to' button if you err somewhere.
    – granite
    Oct 2, 2023 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.