diff options
-rwxr-xr-x | epy.py | 7 | ||||
-rw-r--r-- | pyproject.toml | 2 | ||||
-rw-r--r-- | setup.py | 2 |
3 files changed, 6 insertions, 5 deletions
@@ -23,7 +23,7 @@ examples: """ -__version__ = "2022.3.25" +__version__ = "2022.4.18" __license__ = "GPL-3.0" __author__ = "Benawi Adha" __email__ = "benawiadha@gmail.com" @@ -52,6 +52,7 @@ import textwrap import uuid import xml.etree.ElementTree as ET import zipfile +import zlib from typing import Optional, Union, Sequence, Tuple, List, Dict, Mapping, Set, Type, Any from dataclasses import dataclass, field @@ -720,7 +721,7 @@ class Epub(Ebook): version = content_opf.getroot().get("version") contents = Epub._get_contents(content_opf) - self.contents = tuple(self.root_dirpath + content for content in contents) + self.contents = tuple(urljoin(self.root_dirpath, content) for content in contents) if version in {"1.0", "2.0"}: # "OPF:manifest/*[@id='ncx']" @@ -752,7 +753,7 @@ class Epub(Ebook): try: content = self.file.open(content_path).read() break - except Exception as e: + except zlib.error as e: tries += 1 if max_tries is not None and tries >= max_tries: raise e diff --git a/pyproject.toml b/pyproject.toml index 191a3dc..37971a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "epy-reader" -version = "2022.3.25" +version = "2022.4.18" description = "CLI Ebook Reader" authors = ["Benawi Adha <benawiadha@gmail.com>"] license = "GPL-3.0" @@ -6,7 +6,7 @@ with open("README.md", "r") as fh: setup( name="epy-reader", - version="2022.3.25", + version="2022.4.18", description="Terminal/CLI Ebook (epub, fb2, mobi, azw3) Reader", long_description=long_description, long_description_content_type="text/markdown", |