fix RequestUtils ua

This commit is contained in:
jxxghp
2023-06-17 09:54:58 +08:00
parent 1a74a32384
commit 34e5cce7dc
10 changed files with 20 additions and 17 deletions

View File

@ -46,7 +46,7 @@ class HDArea(_ISiteSigninHandler):
'action': 'sign_in'
}
html_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=proxies
).post_res(url="https://www.hdarea.co/sign_in.php", data=data)
if not html_res or html_res.status_code != 200:

View File

@ -58,7 +58,7 @@ class HDChina(_ISiteSigninHandler):
site_cookie = cookie
# 获取页面html
html_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=proxies
).get_res(url="https://hdchina.org/index.php")
if not html_res or html_res.status_code != 200:
@ -98,7 +98,7 @@ class HDChina(_ISiteSigninHandler):
'csrf': x_csrf
}
sign_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=proxies
).post_res(url="https://hdchina.org/plugin_sign-in.php?cmd=signin", data=data)
if not sign_res or sign_res.status_code != 200:

View File

@ -68,7 +68,7 @@ class HDSky(_ISiteSigninHandler):
img_hash = None
while not img_hash and res_times <= 3:
image_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=settings.PROXY if proxy else None
).post_res(url='https://hdsky.me/image_code_ajax.php',
data={'action': 'new'})
@ -113,7 +113,7 @@ class HDSky(_ISiteSigninHandler):
}
# 访问签到链接
res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=settings.PROXY if proxy else None
).post_res(url='https://hdsky.me/showup.php', data=data)
if res and res.status_code == 200:

View File

@ -114,7 +114,7 @@ class Opencd(_ISiteSigninHandler):
}
# 访问签到链接
sign_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=settings.PROXY if proxy else None
).post_res(url='https://www.open.cd/plugin_sign-in.php?cmd=signin', data=data)
if sign_res and sign_res.status_code == 200:

View File

@ -99,7 +99,7 @@ class Tjupt(_ISiteSigninHandler):
logger.info(f"获取到签到图片 {img_url}")
# 获取签到图片hash
captcha_img_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=settings.PROXY if proxy else None
).get_res(url=img_url)
if not captcha_img_res or captcha_img_res.status_code != 200:
@ -203,7 +203,7 @@ class Tjupt(_ISiteSigninHandler):
}
logger.debug(f"提交data {data}")
sign_in_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=settings.PROXY if proxy else None
).post_res(url=self._sign_in_url, data=data)
if not sign_in_res or sign_in_res.status_code != 200:

View File

@ -77,7 +77,7 @@ class TTG(_ISiteSigninHandler):
}
# 签到
sign_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=settings.PROXY if proxy else None
).post_res(url="https://totheglory.im/signed.php",
data=data)

View File

@ -105,7 +105,7 @@ class U2(_ISiteSigninHandler):
}
# 签到
sign_res = RequestUtils(cookies=site_cookie,
headers=ua,
ua=ua,
proxies=settings.PROXY if proxy else None
).post_res(url="https://u2.dmhy.org/showup.php?action=show",
data=data)