From b95cf6e17966af76a38722e3cf55dee4da4d3278 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Tue, 26 May 2026 09:13:22 -0700 Subject: [PATCH] ignore exceptions when epub parsing (#1360) * ignore exceptions when epub parsing * Update comic2ebook.py * Update comic2ebook.py --- kindlecomicconverter/comic2ebook.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 1fbd156..39a7f19 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -975,10 +975,11 @@ def getWorkFolder(afile, workdir=None): manifest_dict[manifest_item.attrib.get('id')] = manifest_item.attrib.get('href') ordered_image_paths = [] for i, spine_item in enumerate(spine): - if spine_item not in manifest_dict: + try: + page_path = os.path.join(os.path.dirname(opf_path), manifest_dict[spine_item]) + page = ET.parse(page_path) + except Exception: continue - page_path = os.path.join(os.path.dirname(opf_path), manifest_dict[spine_item]) - page = ET.parse(page_path) imgs = page.findall(r'.//{*}img') + page.findall(r'.//{*}image') largest_size = 0