JimmXinu / EpubMerge

EpubMerge Calibre Plugin
GNU General Public License v3.0
111 stars 15 forks source link

Problems when merging #3

Closed LucasGorgal closed 6 years ago

LucasGorgal commented 6 years ago

Hello. I am trying to merge a collection of about 3.000 epubs using EpubMerge. However when Calibre is processing it, after about 3min, it stops and throw me an err.

calibre, version 3.28.0 ERRO: Exceção sem tratamento: ExpatError:not well-formed (invalid token): line 24, column 60 calibre 3.28 embedded-python: True is64bit: True Darwin-17.6.0-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '17.6.0', 'Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64') Python 2.7.12 OSX: ('10.13.5', ('', '', ''), 'x86_64') Interface language: pt_BR Successfully initialized third party plugins: DeDRM (6, 6, 0) && EpubMerge (2, 2, 0) Traceback (most recent call last): File "calibre_plugins.epubmerge.epubmerge_plugin", line 275, in plugin_button File "calibre_plugins.epubmerge.dialogs", line 79, in LoopProgressDialog File "calibre_plugins.epubmerge.epubmerge_plugin", line 573, in _start_merge File "calibre_plugins.epubmerge.epubmerge_plugin", line 162, in do_merge File "calibre_plugins.epubmerge.epubmerge", line 275, in doMerge File "lib/python2.7/xml/dom/minidom.py", line 1928, in parseString File "lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString File "lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString ExpatError: not well-formed (invalid token): line 24, column 60

JimmXinu commented 6 years ago

The error indicates one of your input books epubs has an ncx+xml (TOC) file that contains an ill-formed/invalid token.

Calibre's Convert is more robust. In most input error cases I've seen, doing an epub->epub convert of the input files first will correct the problem.

Here is a version of EpubMerge.zip(click here) that outputs the current input file in the debug output. If you install it and run Calibre in debug mode (under the Calibre Preferences dropdown), the debug log should show which file had the problem.

(It doesn't do that all the time because some characters can cause problems when written to debug output for some users.)

LucasGorgal commented 6 years ago

Hello Jimm. I am astonished to how fast you replied, thank you so much for your attention. I could find the epub file that was causing the err, and by converting it from epub to epub I could successfully merge all of them. Again, thank you so much.

JimmXinu commented 6 years ago

Glad it helped.