aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-10-23 23:17:03 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:12:34 +0200
commit2ea8c77be6bb42ef9e08d0342058736cc5de2025 (patch)
treefa3da25d3fba139b9f5bf843428dd70125a289d0 /plugins
parenta27c0ad520330db55bbb3822ac84a513d9bbd544 (diff)
Readms plugin should only download the chapter requested
It was downloading all the chapters after the selected one as well
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/readms.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/readms.py b/plugins/readms.py
index 2a87b14..4a9674d 100755
--- a/plugins/readms.py
+++ b/plugins/readms.py
@@ -87,7 +87,15 @@ def download_chapter(url, download_dir):
if len(next_pages) != 1:
break
- url = "https://readms.net" + next_pages[0]
+ next_page = next_pages[0]
+ last_slash = next_page.rfind('/')
+ try:
+ if last_slash != -1 and int(next_page[last_slash+1:]) <= img_number:
+ break
+ except ValueError:
+ pass
+
+ url = "https://readms.net" + next_page
img_number += 1
with open(os.path.join(download_dir, "finished"), "w") as file: