fix: 禁用 SSL 证书验证以解决请求失败问题
This commit is contained in:
parent
77619787ae
commit
bcab7d1ac1
4
main.py
4
main.py
@ -149,7 +149,7 @@ def post_with_retry(url, proxy_name, json_payload=None, data=None, headers=None,
|
|||||||
proxies=proxies,
|
proxies=proxies,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
allow_redirects=True, # 允许重定向
|
allow_redirects=True, # 允许重定向
|
||||||
verify=DEFAULT_CACERT, # 不验证 SSL 证书
|
verify=False, # 不验证 SSL 证书
|
||||||
)
|
)
|
||||||
if resp.status_code == 401 and not token_refreshed:
|
if resp.status_code == 401 and not token_refreshed:
|
||||||
if verbose:
|
if verbose:
|
||||||
@ -215,7 +215,7 @@ def gettoken(proxy, r=2):
|
|||||||
try:
|
try:
|
||||||
proxy_str = db.get_proxy(proxy)
|
proxy_str = db.get_proxy(proxy)
|
||||||
url = 'https://graphql.api.dailymotion.com/oauth/token'
|
url = 'https://graphql.api.dailymotion.com/oauth/token'
|
||||||
response = requests.post(url, headers=headers, data=data, proxies={"http": proxy_str, "https": proxy_str},verify=DEFAULT_CACERT)
|
response = requests.post(url, headers=headers, data=data, proxies={"http": proxy_str, "https": proxy_str},verify=False)
|
||||||
token = response.json()['access_token']
|
token = response.json()['access_token']
|
||||||
copy_headers = copy.deepcopy(headers1)
|
copy_headers = copy.deepcopy(headers1)
|
||||||
copy_headers['authorization'] = "Bearer " + token
|
copy_headers['authorization'] = "Bearer " + token
|
||||||
|
Loading…
x
Reference in New Issue
Block a user