From fba95956de38355ab50d2235969ea8e0b94ae868 Mon Sep 17 00:00:00 2001 From: Benedikt McMullin Date: Mon, 2 Jan 2023 21:21:43 +0100 Subject: [PATCH] epub: Skip invalid dc:identifier --- cps/epub.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cps/epub.py b/cps/epub.py index 00ce907b..a807a2e6 100644 --- a/cps/epub.py +++ b/cps/epub.py @@ -102,7 +102,10 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): identifiers = [] for node in p.xpath('dc:identifier', namespaces=ns): - identifier_name = node.attrib.values()[-1] + try: + identifier_name = node.attrib.values()[-1] + except IndexError: + continue identifier_value = node.text if identifier_name in ('uuid', 'calibre') or identifier_value is None: continue