View Single Post
Old 08-17-2015, 10:07 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,382
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you know how to program it should not be hard to wite a script that uses the check book infrastructure to auto-fix correctable errors and run it via calibre-debug

Something as simple as

Code:
from calibre.ebooks.oeb.polish.check.main import run_checks, fix_errors
from calibre.ebooks.oeb.polish.container import get_container

import sys
filepath = sys.argv[-1]
container = get_container(filepath, tweak_mode=True)
errors = run_checks(container)
if errors:
    print ('Found errors, trying to fix them')
    if fix_errors(container, errors):
        container.commit()
kovidgoyal is offline   Reply With Quote