aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xplugins/manganelo.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/plugins/manganelo.py b/plugins/manganelo.py
index 3ce51b8..b19d3e9 100755
--- a/plugins/manganelo.py
+++ b/plugins/manganelo.py
@@ -89,9 +89,24 @@ def download_chapter(url, download_dir):
print("Downloading {} to {}".format(image_source, image_path))
file_size = download_file(image_source, image_path)
if file_size < 255:
- print("resource temporary unavailable: %s" % image_source)
- os.remove(in_progress_filepath)
- exit(2)
+ try_backup_url = False
+ new_image_source = image_source.replace("s3.mkklcdnv3.com", "bu.mkklcdnbuv1.com")
+ if new_image_source != image_source:
+ try_backup_url = True
+ else:
+ new_image_source = image_source.replace("s41.mkklcdnv41.com", "bu.mkklcdnbuv1.com")
+ try_backup_url = (new_image_source != image_source)
+
+ if try_backup_url:
+ file_size = download_file(new_image_source, image_path)
+ if file_size < 255:
+ print("resource temporary unavailable: %s" % new_image_source)
+ os.remove(in_progress_filepath)
+ exit(2)
+ else:
+ print("resource temporary unavailable: %s" % image_source)
+ os.remove(in_progress_filepath)
+ exit(2)
img_number += 1
if img_number == 1: