aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-08-12 17:33:09 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-12 17:33:13 +0200
commitc76c8696bc66437fdffb52f87a15b338df3b93cc (patch)
treea5a54195b857109d899f3bb2d749cdacd9381738
parent41ac3fe0e8d89be22f0e0e6f9db8accd25a99573 (diff)
Fix manganelo images not downloading (cloudflare ddos protection)
-rwxr-xr-xautomediabin112552 -> 116592 bytes
-rwxr-xr-xplugins/manganelo.py11
2 files changed, 10 insertions, 1 deletions
diff --git a/automedia b/automedia
index 1c727b9..c270422 100755
--- a/automedia
+++ b/automedia
Binary files differ
diff --git a/plugins/manganelo.py b/plugins/manganelo.py
index b19d3e9..a577d4b 100755
--- a/plugins/manganelo.py
+++ b/plugins/manganelo.py
@@ -32,7 +32,16 @@ if len(sys.argv) < 2:
def download_file(url, save_path):
file_size = 0
- with requests.get(url, stream=True) as response:
+ headers = {
+ "accept-language": "en-US,en;q=0.9",
+ "accept": "image/webp,image/apng,image/*,*/*;q=0.8",
+ "sec-fetch-site": "cross-site",
+ "sec-fetch-mode": "no-cors",
+ "sec-fetch-dest": "image",
+ "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:
if not response.ok:
return 0
with open(save_path, "wb") as file: