aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-08-17 18:26:10 +0200
committerdec05eba <dec05eba@protonmail.com>2022-08-17 18:26:10 +0200
commitb1d22577f160b003e81cb45cf9d29ced19984fe0 (patch)
tree91e8f410018e419f7a96506ea793d4872a9798ed
parent1b6fcd828dc18d6fe105387653352945a51800c1 (diff)
Mangakatana: try different image mirror if download fails
-rwxr-xr-xplugins/mangakatana.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/mangakatana.py b/plugins/mangakatana.py
index 02337d1..4686715 100755
--- a/plugins/mangakatana.py
+++ b/plugins/mangakatana.py
@@ -106,9 +106,11 @@ def download_chapter(url, download_dir):
image_path = os.path.join(download_dir, image_name)
print("Downloading {} to {}".format(image_source, image_path))
if not download_file(image_source, image_path):
- print("Failed to download image: %s" % image_source)
- os.remove(in_progress_filepath)
- exit(2)
+ image_source = image_source.replace("://i3", "://i2")
+ if not download_file(image_source, image_path):
+ print("Failed to download image: %s" % image_source)
+ os.remove(in_progress_filepath)
+ exit(2)
img_number += 1
if img_number == 1: