aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md17
-rwxr-xr-xepy.py13
-rw-r--r--pyproject.toml2
-rw-r--r--setup.py2
4 files changed, 26 insertions, 8 deletions
diff --git a/README.md b/README.md
index 6a3bfa4..c92a867 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ This is just a fork of my own [epr](https://github.com/wustho/epr) with these ex
- FictionBook (.fb2)
- Mobi (.mobi)
- AZW3 (.azw, .azw3)
- - URL
+ - [URL](#url-support)
- Reading progress percentage
- Bookmarks
- External dictionary integration (`sdcv` or `dict`)
@@ -65,6 +65,19 @@ Config file is available in json format which is located at:
Although, there are not many stuffs to configure.
+## URL Support
+
+You can read online books like: short stories, fan fiction, etc. using `epy`with url.
+Pretty useful when you want to read with less distraction.
+`epy` will also remember your reading progress online.
+
+eg. You can read [Moby Dick from gutenberg](https://www.gutenberg.org/files/2701/2701-h/2701-h.htm)
+directly with:
+
+```shell
+$ epy https://www.gutenberg.org/files/2701/2701-h/2701-h.htm
+```
+
## Using Mouse
Although mouse support is useful when running `epy` on Termux Android, it’s disabled by default
@@ -103,6 +116,8 @@ so line scrolling navigation will act as scrolling page and textwidth is not adj
- `v2022.1.8`: Change in configuration and reading states schema that is not backward compatible.
So if error is encountered, deleting the configuration and states file might fix the issue.
+- `v2022.1.15`: Early implementation of URL support, table of contents isn't available for now.
+
## Tip Jar
[https://paypal.me/wustho](https://paypal.me/wustho)
diff --git a/epy.py b/epy.py
index 5060850..1572ad0 100755
--- a/epy.py
+++ b/epy.py
@@ -22,7 +22,7 @@ examples:
"""
-__version__ = "2022.1.8"
+__version__ = "2022.1.15"
__license__ = "GPL-3.0"
__author__ = "Benawi Adha"
__email__ = "benawiadha@gmail.com"
@@ -931,7 +931,7 @@ class URL(Ebook):
return self.html
def get_img_bytestr(self, src: str) -> Tuple[str, bytes]:
- image_url = urljoin(self.path, src)
+ image_url = src if is_url(src) else urljoin(self.path, src)
# TODO: catch error on request
with urlopen(Request(image_url, headers=URL._header)) as response:
byte_str = response.read()
@@ -2520,9 +2520,12 @@ class Reader:
@text_win
def show_win_metadata(self):
- mdata = "[File Info]\nPATH: {}\nSIZE: {} MB\n \n[Book Info]\n".format(
- self.ebook.path, round(os.path.getsize(self.ebook.path) / 1024 ** 2, 2)
- )
+ if os.path.isfile(self.ebook.path):
+ mdata = "[File Info]\nPATH: {}\nSIZE: {} MB\n \n[Book Info]\n".format(
+ self.ebook.path, round(os.path.getsize(self.ebook.path) / 1024 ** 2, 2)
+ )
+ else:
+ mdata = "[File Info]\nPATH: {}\n \n[Book Info]\n".format(self.ebook.path)
book_metadata = self.ebook.get_meta()
for field in dataclasses.fields(book_metadata):
diff --git a/pyproject.toml b/pyproject.toml
index 333d536..f2527a8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "epy-reader"
-version = "2022.1.8"
+version = "2022.1.15"
description = "CLI Ebook Reader"
authors = ["Benawi Adha <benawiadha@gmail.com>"]
license = "GPL-3.0"
diff --git a/setup.py b/setup.py
index 0c54787..7b25816 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
setup(
name="epy-reader",
- version="2022.1.8",
+ version="2022.1.15",
description="Terminal/CLI Ebook (epub, fb2, mobi, azw3) Reader",
long_description=long_description,
long_description_content_type="text/markdown",