aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xplugins/manganelo.py26
1 files changed, 7 insertions, 19 deletions
diff --git a/plugins/manganelo.py b/plugins/manganelo.py
index a577d4b..50c71e5 100755
--- a/plugins/manganelo.py
+++ b/plugins/manganelo.py
@@ -41,7 +41,10 @@ def download_file(url, save_path):
"referer": "https://manganelo.com/",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
}
- with requests.get(url, stream=True, headers=headers) as response:
+ cookies = {
+ "content_server": "server2"
+ }
+ with requests.get(url, stream=True, headers=headers, cookies=cookies) as response:
if not response.ok:
return 0
with open(save_path, "wb") as file:
@@ -98,24 +101,9 @@ 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:
- 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)
+ print("resource temporary unavailable: %s" % image_source)
+ os.remove(in_progress_filepath)
+ exit(2)
img_number += 1
if img_number == 1: