summaryrefslogtreecommitdiff
path: root/libmat2/epub.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmat2/epub.py')
-rw-r--r--libmat2/epub.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmat2/epub.py b/libmat2/epub.py
index 390ee63..fd38411 100644
--- a/libmat2/epub.py
+++ b/libmat2/epub.py
@@ -15,11 +15,12 @@ class EPUBParser(archive.ZipParser):
15 'META-INF/container.xml', 15 'META-INF/container.xml',
16 'mimetype', 16 'mimetype',
17 'OEBPS/content.opf', 17 'OEBPS/content.opf',
18 'content.opf',
18 })) 19 }))
19 self.uniqid = uuid.uuid4() 20 self.uniqid = uuid.uuid4()
20 21
21 def _specific_get_meta(self, full_path, file_path): 22 def _specific_get_meta(self, full_path, file_path):
22 if file_path != 'OEBPS/content.opf': 23 if not file_path.endswith('content.opf'):
23 return {} 24 return {}
24 25
25 with open(full_path, encoding='utf-8') as f: 26 with open(full_path, encoding='utf-8') as f:
@@ -31,7 +32,7 @@ class EPUBParser(archive.ZipParser):
31 return {file_path: 'harmful content', } 32 return {file_path: 'harmful content', }
32 33
33 def _specific_cleanup(self, full_path: str): 34 def _specific_cleanup(self, full_path: str):
34 if full_path.endswith('OEBPS/content.opf'): 35 if full_path.endswith('content.opf'):
35 return self.__handle_contentopf(full_path) 36 return self.__handle_contentopf(full_path)
36 elif full_path.endswith('OEBPS/toc.ncx'): 37 elif full_path.endswith('OEBPS/toc.ncx'):
37 return self.__handle_tocncx(full_path) 38 return self.__handle_tocncx(full_path)