aboutsummaryrefslogtreecommitdiff
path: root/plugins
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 /plugins
parent33990a67620c185788a7e92bf96291d7126c3010 (diff)
Exit manga download on failure
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/manganelo.py3
-rwxr-xr-xplugins/readms.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/manganelo.py b/plugins/manganelo.py
index 1526e6f..25114fa 100755
--- a/plugins/manganelo.py
+++ b/plugins/manganelo.py
@@ -73,7 +73,8 @@ def download_chapter(url, download_dir):
image_name = str(img_number) + ext
image_path = os.path.join(download_dir, image_name)
print("Downloading {} to {}".format(image_source, image_path))
- download_file(image_source, image_path)
+ if not download_file(image_source, image_path):
+ exit(1)
img_number += 1
with open(os.path.join(download_dir, "finished"), "w") as file:
diff --git a/plugins/readms.py b/plugins/readms.py
index d88deb1..878a043 100755
--- a/plugins/readms.py
+++ b/plugins/readms.py
@@ -79,7 +79,8 @@ def download_chapter(url, download_dir):
image_name = str(img_number) + ext
image_path = os.path.join(download_dir, image_name)
print("Downloading {} to {}".format(image_source, image_path))
- download_file(image_source, image_path)
+ if not download_file(image_source, image_path):
+ exit(1)
next_pages = tree.xpath('//div[@class="page"]//a/@href')
if len(next_pages) != 1: