aboutsummaryrefslogtreecommitdiff
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
parenta27c0ad520330db55bbb3822ac84a513d9bbd544 (diff)
Readms plugin should only download the chapter requested
It was downloading all the chapters after the selected one as well
-rw-r--r--README.md1
-rwxr-xr-xplugins/readms.py10
2 files changed, 10 insertions, 1 deletions
diff --git a/README.md b/README.md
index 73dd63e..03da144 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,7 @@ Run automedia without any options to see all options.
## TODO
1. Periodically check and remove in_progress files and their directories. This can happen if the computer crashes while adding rss.
2. Automatically remove torrents that have finished seeding, to reduce memory usage and startup time of transmission.
+3. Only allow one instance of automedia to run at a time. This is to prevent the config from being corrupt.
# Requirements
## System
transmission-cli, notify-send (optional)
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: