feat
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
mol
2023-09-05 18:06:07 +08:00
parent b084a76ce8
commit 5157f4f8d2
13 changed files with 351 additions and 137 deletions

21
handlers/pixiv/request.py Normal file
View File

@ -0,0 +1,21 @@
import requests
import os
requests.packages.urllib3.disable_warnings()
def downloadPic(url):
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 QIHU 360SE",
}
data = None
status = False
try:
proxies={'https': os.getenv('https_proxy'),'http': os.getenv('http_proxy')}
res = requests.get(url, headers = headers, verify=False, timeout=(5,5), proxies=proxies)
data = res.content
status = True
res.close()
print(f'Info: download success {url}')
except:
print(f'Error: download failed {url}')
return (status, data)