aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: