aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
Diffstat (limited to 'epy.py')
-rwxr-xr-xepy.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/epy.py b/epy.py
index afdca4e..f92161a 100755
--- a/epy.py
+++ b/epy.py
@@ -209,7 +209,10 @@ class Epub:
src = i.get("href")
name = "".join(list(i.itertext()))
src = src.split("#")
- idx = contents.index(unquote(src[0]))
+ try:
+ idx = contents.index(unquote(src[0]))
+ except ValueError:
+ continue
self.toc_entries[0].append(name)
self.toc_entries[1].append(idx)
if len(src) == 2:
@@ -302,7 +305,10 @@ class Mobi(Epub):
src = i.get("href")
name = "".join(list(i.itertext()))
src = src.split("#")
- idx = contents.index(unquote(src[0]))
+ try:
+ idx = contents.index(unquote(src[0]))
+ except ValueError:
+ continue
self.toc_entries[0].append(name)
self.toc_entries[1].append(idx)
if len(src) == 2: