From 2ea8c77be6bb42ef9e08d0342058736cc5de2025 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 23 Oct 2019 23:17:03 +0200 Subject: Readms plugin should only download the chapter requested It was downloading all the chapters after the selected one as well --- plugins/readms.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/readms.py') 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: -- cgit v1.2.3