diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-08-12 17:33:09 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-12 17:33:13 +0200 |
commit | c76c8696bc66437fdffb52f87a15b338df3b93cc (patch) | |
tree | a5a54195b857109d899f3bb2d749cdacd9381738 | |
parent | 41ac3fe0e8d89be22f0e0e6f9db8accd25a99573 (diff) |
Fix manganelo images not downloading (cloudflare ddos protection)
-rwxr-xr-x | automedia | bin | 112552 -> 116592 bytes | |||
-rwxr-xr-x | plugins/manganelo.py | 11 |
2 files changed, 10 insertions, 1 deletions
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: |