aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwustho <benawiadha@gmail.com>2020-04-22 22:33:22 +0700
committerwustho <benawiadha@gmail.com>2020-04-22 22:33:22 +0700
commit60e95ffce698b9a12bf86341d813aefe1a6c9651 (patch)
treeeb00e30e46967dd72aec84e052e3ebe022c83e6e
parentdd29d8ee286929ee588f6d224b554b3f793aaaa3 (diff)
downloadepy-60e95ffce698b9a12bf86341d813aefe1a6c9651.tar.gz
Fixed: zlib.error: Error -3 while decompressing data:
invalid distance too far back.
-rw-r--r--README.md1
-rwxr-xr-xepy.py7
2 files changed, 7 insertions, 1 deletions
diff --git a/README.md b/README.md
index a2f34ab..57e0faa 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,7 @@ CLI Ebook Reader.
This is just a fork of my own [epr](https://github.com/wustho/epr) with these extra features:
+- Faster (Noticeable when reading thick ebook >2MB)
- FictionBook (.fb2) support
- Reading progress percentage
- Bookmarks
diff --git a/epy.py b/epy.py
index 1854fa7..85639c9 100755
--- a/epy.py
+++ b/epy.py
@@ -211,7 +211,12 @@ class Epub:
self.toc_entries[2].append("")
def get_raw_text(self, chpath):
- content = self.file.open(chpath).read()
+ while True:
+ try:
+ content = self.file.open(chpath).read()
+ break
+ except:
+ continue
return content.decode("utf-8")
def get_img_bytestr(self, impath):