diff options
author | wustho <benawiadha@gmail.com> | 2020-04-22 22:33:22 +0700 |
---|---|---|
committer | wustho <benawiadha@gmail.com> | 2020-04-22 22:33:22 +0700 |
commit | 60e95ffce698b9a12bf86341d813aefe1a6c9651 (patch) | |
tree | eb00e30e46967dd72aec84e052e3ebe022c83e6e | |
parent | dd29d8ee286929ee588f6d224b554b3f793aaaa3 (diff) | |
download | epy-60e95ffce698b9a12bf86341d813aefe1a6c9651.tar.gz |
Fixed: zlib.error: Error -3 while decompressing data:
invalid distance too far back.
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | epy.py | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -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 @@ -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): |