Skip to content
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

problem with an EPub (3 ?) file in EubMerge #17

Closed
jacquesqu opened this issue Jul 15, 2024 · 13 comments
Closed

problem with an EPub (3 ?) file in EubMerge #17

jacquesqu opened this issue Jul 15, 2024 · 13 comments

Comments

@jacquesqu
Copy link

Hello. No matter how hard I try (converting from EPub to EPub, converting from EPub to Mobi and then back to EPub...), there is a file that definitely will not go into a "collected" EPubMerge file - every time it says it tries to convert it form Eub3 to EPub2 for the sake of merging, but eventually nothing doing. Anything I can do about this ?

@JimmXinu
Copy link
Owner

I'd have to see the problem epub. Can you share it?

Or at least, the debug output of the attempt. Calibre Preferences dropdown has a 'Restart in debug' option.

@jacquesqu
Copy link
Author

jacquesqu commented Jul 15, 2024

OK, I gave it another try with another version of same EPub (much larger than the other ones, that were less than 1 Mb), same failure, but at least I found it where it is supposed to be in Calibre, but it tells me here "we don't support that file type".
I did restart Calibre in debug mode but dont know what to do once the operation failed. Here anyway is the the full text after the failed operation (it seems to end abruptly at some point) :

EpubMerge : Un été avec ... (1-12)
DeDRM v10.0.9: Trying to decrypt input_73228_8gk85f9j.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: Post-processing took 0.1 seconds
DeDRM v10.0.9: Finished after 0.7 seconds
==================================================
Found EPUB3 for Un été avec Paul Valéry par Régis Debray, automatically creating a temporary EPUB2 for merging...

Conversion options changed from defaults:
  output_profile: 'tablet'
  no_default_epub_cover: True
DeDRM v10.0.9: Trying to decrypt wfbryj2j.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: Post-processing took 0.0 seconds
DeDRM v10.0.9: Finished after 0.6 seconds
1% Conversion de l’entrée en HTML…
InputFormatPlugin: EPUB Input running
on C:\Users\SUPERV~1\AppData\Local\Temp\calibre_5xhhne62\wfg8_xpd.epub
Found HTML cover OEBPS/Text/titlepage.xhtml
Parsing all content...
34% Exécution des transformations du livre numérique…
Merging user specified metadata...
Detecting structure...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Trimming 'OEBPS/toc.xhtml' from manifest
Creating EPUB Output...
67% Exécution de l'extension EPUB Output
The image OEBPS/Images/pub2.jpg is in the CMYK colorspace, converting it to RGB as Adobe Digital Editions cannot display CMYK
The image OEBPS/Images/pub4.jpg is in the CMYK colorspace, converting it to RGB as Adobe Digital Editions cannot display CMYK
The image OEBPS/Images/pub3.jpg is in the CMYK colorspace, converting it to RGB as Adobe Digital Editions cannot display CMYK
The image OEBPS/Images/pub1.jpg is in the CMYK colorspace, converting it to RGB as Adobe Digital Editions cannot display CMYK
The image OEBPS/Images/pub5.jpg is in the CMYK colorspace, converting it to RGB as Adobe Digital Editions cannot display CMYK
Splitting markup on page breaks and flow limits, if any...
	Looking for large trees in OEBPS/Text/T023.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T024.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T025.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T026.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T013.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T004.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T003.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T006.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T007.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T010.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T027.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T028.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T014.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T029.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T015.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T030.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T031.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T032.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T033.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T034.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T035.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T036.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T037.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T011.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T016.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T017.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T012.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T018.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T005.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T002.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T008.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T009.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T019.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T020.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T021.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T022.xhtml...
	No large trees found
EPUB output written to C:\Users\SUPERV~1\AppData\Local\Temp\calibre_5xhhne62\epubmerge_ovfepr9r\epub2_ju5c09fa.epub
Sortie sauvegardée vers   C:\Users\SUPERV~1\AppData\Local\Temp\calibre_5xhhne62\epubmerge_ovfepr9r\epub2_ju5c09fa.epub
DeDRM v10.0.9: Trying to decrypt input_35994_qdwvro_f.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: Post-processing took 0.1 seconds
DeDRM v10.0.9: Finished after 0.1 seconds
Converted to temporary EPUB2: C:\Users\SUPERV~1\AppData\Local\Temp\calibre_5xhhne62\epubmerge_ovfepr9r\epub2_ju5c09fa.epub
==================================================
Found EPUB3 for Un été avec Colette par Antoine Compagnon, automatically creating a temporary EPUB2 for merging...

Conversion options changed from defaults:
  output_profile: 'tablet'
  no_default_epub_cover: True
DeDRM v10.0.9: Trying to decrypt 1ifngpwu.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: Post-processing took 0.1 seconds
DeDRM v10.0.9: Finished after 0.1 seconds
1% Conversion de l’entrée en HTML…
InputFormatPlugin: EPUB Input running
on C:\Users\SUPERV~1\AppData\Local\Temp\calibre_5xhhne62\x1s7wh_g.epub
Parsing all content...
Referenced file 'js/kobo.js' not found
34% Exécution des transformations du livre numérique…
Merging user specified metadata...
Detecting structure...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Trimming 'OEBPS/toc.xhtml' from manifest
Trimming 'OEBPS/toc.ncx' from manifest
Creating EPUB Output...
67% Exécution de l'extension EPUB Output
Splitting markup on page breaks and flow limits, if any...
	Looking for large trees in OEBPS/Text/T020.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T021.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T022.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T016.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T014.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T019.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T017.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T005.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T002.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T010.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T011.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T012.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T018.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T023.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T024.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T025.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T043.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T026.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T027.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/PUB_Equateurs.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T028.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T036.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T029.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T035.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T031.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T032.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T037.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T034.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T040.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T042.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T015.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T001.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T003.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T004.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T006.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T007.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T008.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T009.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T030.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T033.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T038.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T039.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T013.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T044.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T045.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T041.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/T046.xhtml...
	No large trees found
	Looking for large trees in OEBPS/Text/notes.xhtml...
	No large trees found
The cover image has an id != "cover". Renaming to work around bug in Nook Color
EPUB output written to C:\Users\SUPERV~1\AppData\Local\Temp\calibre_5xhhne62\epubmerge_ovfepr9r\epub2_vlfd_nyr.epub
Sortie sauvegardée vers   C:\Users\SUPERV~1\AppData\Local\Temp\calibre_5xhhne62\epubmerge_ovfepr9r\epub2_vlfd_nyr.epub
EpubMerge: DEBUG: 2024-07-15 16:59:04,050: calibre_plugins.epubmerge.epubmerge(271): prep output:0.0009975433349609375
EpubMerge: DEBUG: 2024-07-15 16:59:04,054: calibre_plugins.epubmerge.epubmerge(443): write rootfile content.opf to 1/content.opf
EpubMerge: DEBUG: 2024-07-15 16:59:04,073: calibre_plugins.epubmerge.epubmerge(480): write toc.ncx toc.ncx to 1/toc.ncx
EpubMerge: DEBUG: 2024-07-15 16:59:04,210: calibre_plugins.epubmerge.epubmerge(506): bookid:a1
EpubMerge: DEBUG: 2024-07-15 16:59:04,211: calibre_plugins.epubmerge.epubmerge(507): itemreflist[0].getAttribute(idref):titlepage
EpubMerge: DEBUG: 2024-07-15 16:59:04,213: calibre_plugins.epubmerge.epubmerge(443): write rootfile content.opf to 2/content.opf
EpubMerge: DEBUG: 2024-07-15 16:59:04,241: calibre_plugins.epubmerge.epubmerge(480): write toc.ncx toc.ncx to 2/toc.ncx
EpubMerge: DEBUG: 2024-07-15 16:59:04,255: calibre_plugins.epubmerge.epubmerge(506): bookid:a2
EpubMerge: DEBUG: 2024-07-15 16:59:04,255: calibre_plugins.epubmerge.epubmerge(507): itemreflist[0].getAttribute(idref):titlepage
EpubMerge: DEBUG: 2024-07-15 16:59:04,257: calibre_plugins.epubmerge.epubmerge(443): write rootfile OEBPS/content.opf to 3/OEBPS/content.opf
EpubMerge: DEBUG: 2024-07-15 16:59:04,273: calibre_plugins.epubmerge.epubmerge(480): write toc.ncx OEBPS/toc.ncx to 3/OEBPS/toc.ncx
EpubMerge: INFO: 2024-07-15 16:59:04,280: calibre_plugins.epubmerge.epubmerge(493): Decrypting font file: Fonts/font00079.ttf
Traceback (most recent call last):
  File "runpy.py", line 198, in _run_module_as_main
  File "runpy.py", line 88, in _run_code
  File "site.py", line 83, in <module>
  File "site.py", line 78, in main
  File "site.py", line 50, in run_entry_point
  File "calibre\utils\ipc\worker.py", line 215, in main
  File "calibre\utils\ipc\worker.py", line 150, in arbitrary_n
  File "calibre_plugins.epubmerge.jobs", line 84, in do_merge_bg
  File "calibre_plugins.epubmerge.epubmerge", line 494, in doMerge
  File "calibre_plugins.epubmerge.epubmerge", line 159, in get_decrypted_font_data
  File "calibre_plugins.epubmerge.epubmerge", line 148, in get_adobe_key
AttributeError: 'NoneType' object has no attribute 'rpartition'
Converted to temporary EPUB2: C:\Users\SUPERV~1\AppData\Local\Temp\calibre_5xhhne62\epubmerge_ovfepr9r\epub2_vlfd_nyr.epub
==================================================

Beginning Merge...

==================================================

EDIT -- I added code block ``` marks around this for legibility. @JimmXinu

@jacquesqu
Copy link
Author

Hmm... Sorry, obvioulsy I'm REALLY not good at it, what appears "deleted" in what I just sent isn't in Calibre.

@jacquesqu
Copy link
Author

I should add that I tried to merge it with anther random EPub and it worked. It's when I ry to merge it with 11 (small) EPubs of the same series that the probem occurs, so it sems not to be linked 100% with that file itself.

@JimmXinu
Copy link
Owner

It's pretty clear what part has failed:

EpubMerge: INFO: 2024-07-15 16:59:04,280: calibre_plugins.epubmerge.epubmerge(493): Decrypting font file: Fonts/font00079.ttf
Traceback (most recent call last):
  File "runpy.py", line 198, in _run_module_as_main
  File "runpy.py", line 88, in _run_code
  File "site.py", line 83, in <module>
  File "site.py", line 78, in main
  File "site.py", line 50, in run_entry_point
  File "calibre\utils\ipc\worker.py", line 215, in main
  File "calibre\utils\ipc\worker.py", line 150, in arbitrary_n
  File "calibre_plugins.epubmerge.jobs", line 84, in do_merge_bg
  File "calibre_plugins.epubmerge.epubmerge", line 494, in doMerge
  File "calibre_plugins.epubmerge.epubmerge", line 159, in get_decrypted_font_data
  File "calibre_plugins.epubmerge.epubmerge", line 148, in get_adobe_key
AttributeError: 'NoneType' object has no attribute 'rpartition'

Your other epubs probably don't have 'encrypted' fonts, or have 'encrypted' fonts that decrypt correctly.

Without a copy of one of the failing epubs to experiment with, the best I could do is catch that exception and either fail the merge or go ahead knowing that there's a good chance embedded fonts will be broken. And there's no guarantee I'll be able to fix it with an epub.

Encrypted fonts in epubs was discussed in my EpubSplit plugin thread. One work around found at the time was to delete META-INF/encryption.xml from the epub while in Calibre's Edit book and when you save the epub, it won't re-encrypt the TTF file again.

@jacquesqu
Copy link
Author

OK, thanks. When I try to debug the EPub in Calibre, the only 2 errors rthat show up are this :

OEBPS/Styles/style.css (ligne : 56 colonne : 0)
Unexpected duplicate selector "a", first used at line 3 (no-duplicate-selectors). Voir description détaillée.

and this :

OEBPS/Styles/style.css (ligne : 60 colonne : 8)
Unexpected unknown property "page-brek-inside" (property-no-unknown). Voir description détaillée.

none of which goes away when I make Calibre try to solve all repairable problems.

I would gladly delete any META-INF/encryption.xml present, except I don't know where to look for it. It doesn't seem to appear anywhere when I search for it in the Calibre editing page, including when I try to search for it (there is only a META-INF/container.xml...

@JimmXinu
Copy link
Owner

I've helped as much as I can without seeing the problem myself.

Could you share it using the ScrambleEbook plugin?

@jacquesqu
Copy link
Author

I had to send via e-mail because this site doesn't accept EPub attachments, tell me whether you did get it. And sorry my lack of technical know-how makes this more time-consuming than it should for sure...

@JimmXinu
Copy link
Owner

I didn't get it. Put the epub inside a zip file--or just rename it, an epub is a zip file. Then you should be able to attach it here.

@JimmXinu
Copy link
Owner

The whole point of ScrambleBook is so you don't have to share the original copyrighted material.

Regardless, this epub "Un été avec Paul Valéry" doesn't have any embedded fonts, and works fine in EpubMerge for me.

Your log above suggests it's "Un été avec Colette par Antoine Compagnon" that has a problem.

@jacquesqu
Copy link
Author

Ah... So they'll take me to jail, will they... OK, I deleted the post.
I tried to edit the one you said, there was seemingly no META-INF/encryption.xml present. EPub -> Mobi -> EPub didn't work. Downloaded a larger file of same EPub, same issue occurred. Still, like the first one, It merged fine if I tried with one other file, not for the whole collection.
So I repeatedly merged and merged (thank goodness it's quick), adding them one by one, and it turned out that the one that blocked the process was "Un été avec Baudelaire". So I edited it, it turned out ths one DID have a META-INF/encryption.xml, which I deleted as you suggested and then it WORKED,
THANK YOU VERY MUCH !
(The only thing that remains to be seen is why Calibre was seemingly pointing its finger at the one I first thought was the culprit, but that's an issue of little importance - as long as you don't have a problem trying to merge 150 files and have to pick the wrong one by trial and error like I did for those 12 !)

@JimmXinu
Copy link
Owner

I can, at least, help with identifying the problem. 46716b0 causes the title/author(s)/temp file name to be output in the Job log.

Test version of plugin posted here.

@jacquesqu
Copy link
Author

Hello. I installed the updated version of the plugin, many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants