From 60e95ffce698b9a12bf86341d813aefe1a6c9651 Mon Sep 17 00:00:00 2001 From: wustho Date: Wed, 22 Apr 2020 22:33:22 +0700 Subject: Fixed: zlib.error: Error -3 while decompressing data: invalid distance too far back. --- epy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'epy.py') 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): -- cgit