aboutsummaryrefslogtreecommitdiff
path: root/automedia.py
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-06-06 18:49:24 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:12:34 +0200
commit4b19a46148d8c739ae3e558290ce37a30a28f292 (patch)
tree5d05d07d0faa8aef712d779eb4590a5834053443 /automedia.py
parent33990a67620c185788a7e92bf96291d7126c3010 (diff)
Exit manga download on failure
Diffstat (limited to 'automedia.py')
-rwxr-xr-xautomedia.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/automedia.py b/automedia.py
index 4d6f140..171108b 100755
--- a/automedia.py
+++ b/automedia.py
@@ -327,14 +327,12 @@ def resume_tracked_html(plugin_entry, download_dir, tracked_html, session_id):
item_session_id = file.read()
if item_session_id != session_id:
invalid_session = True
- plugin_download(plugin_entry, url, item_dir)
- show_notification("Resuming", "Resuming download for item {} with plugin {}".format(item, tracked_html.plugin))
except FileNotFoundError as e:
invalid_session = True
- plugin_download(plugin_entry, url, item_dir)
- show_notification("Resuming", "Resuming download for item {} with plugin {}".format(item, tracked_html.plugin))
if invalid_session:
+ plugin_download(plugin_entry, url, item_dir)
+ show_notification("Resuming", "Resuming download for item {} with plugin {}".format(item, tracked_html.plugin))
with open(os.path.join(item_dir, "session_id"), "w") as file:
file.write(session_id)
except FileNotFoundError as e:
@@ -377,9 +375,6 @@ def sync_html(tracked_html, download_dir, session_id):
# A file called "finished" should be added to the download directory when the download has finished.
# ./program download url download_dir
latest = None
- if len(items["items"]) > 0:
- latest = items["items"][0]["name"].replace("/", "_")
-
for item in reversed(items["items"]):
url = item["url"]
name = item["name"].replace("/", "_")