mirror of
https://github.com/ciromattia/kcc
synced 2026-07-29 08:03:16 +00:00
ignore exceptions when epub parsing (#1360)
* ignore exceptions when epub parsing * Update comic2ebook.py * Update comic2ebook.py
This commit is contained in:
@@ -975,10 +975,11 @@ def getWorkFolder(afile, workdir=None):
|
|||||||
manifest_dict[manifest_item.attrib.get('id')] = manifest_item.attrib.get('href')
|
manifest_dict[manifest_item.attrib.get('id')] = manifest_item.attrib.get('href')
|
||||||
ordered_image_paths = []
|
ordered_image_paths = []
|
||||||
for i, spine_item in enumerate(spine):
|
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
|
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')
|
imgs = page.findall(r'.//{*}img') + page.findall(r'.//{*}image')
|
||||||
|
|
||||||
largest_size = 0
|
largest_size = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user