https://match.yuanrenxue.cn/match/19
发包测试
经过发包测试,并没有携带加密参数,但是使用python无法复现,requests
,httpx
以及异步都不行,网上搜索了一下,这是使用了JA3
指纹。可能是我做的时间比较晚,现在已经有比较成熟的方案了,看到做得早的人各种坑,这就是竞技的魅力?
参考文章
这里直接使用魔改Python
库 curl_cffi
构建请求即可。
from curl_cffi import requests
# 自定义请求头
headers = {
"authority": "match.yuanrenxue.cn",
"accept": "application/json, text/javascript, */*; q=0.01",
"accept-language": "zh-CN,zh;q=0.9",
"referer": "https://match.yuanrenxue.cn/match/19",
"sec-ch-ua": "\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Google Chrome\";v=\"122\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36",
"x-requested-with": "XMLHttpRequest"
}
# 自定义cookies
cookies = {
"sessionid": "zwy0uz1vd0ge1e42310i34b37584m1lj",
"m": "fb000f94e1ee96b8ffb346da6bc5e2bb|1717678387000",
"Hm_lvt_c99546cf032aaa5a679230de9a95c7db": "1717646819,1717658072,1717660207,1717678388",
"qpfccr": "true",
"no-alert3": "true",
"Hm_lvt_9bcbda9cbf86757998a2339a0437208e": "1717639423,1717658081,1717660212,1717678393",
"Hm_lpvt_9bcbda9cbf86757998a2339a0437208e": "1717680121",
"Hm_lpvt_c99546cf032aaa5a679230de9a95c7db": "1717680125"
}
# 请求URL
url = "https://match.yuanrenxue.cn/api/match/19"
ret = 0
# 遍历 page 参数从 1 到 5
for page in range(1, 6):
# 请求参数
params = {
"page": str(page)
}
# 使用curl_cffi发送GET请求
response = requests.get(url, headers=headers, cookies=cookies, params=params, impersonate="chrome101")
print(response.json())
for item in response.json()["data"]:
ret += item["value"]
print(ret)
{'status': '1', 'state': 'success', 'data': [{'value': 7396}, {'value': 5018}, {'value': 9546}, {'value': 4476}, {'value': 5297}, {'value': 880}, {'value': 4644}, {'value': 5918}, {'value': 3853}, {'value': 1572}]}
{'status': '1', 'state': 'success', 'data': [{'value': 598}, {'value': 7909}, {'value': 3154}, {'value': 5765}, {'value': 9811}, {'value': 1361}, {'value': 2173}, {'value': 2422}, {'value': 9863}, {'value': 7831}]}
{'status': '1', 'state': 'success', 'data': [{'value': 3232}, {'value': 2458}, {'value': 3597}, {'value': 381}, {'value': 9069}, {'value': 1550}, {'value': 3054}, {'value': 5125}, {'value': 5520}, {'value': 8382}]}
{'status': '1', 'state': 'success', 'data': [{'value': 8409}, {'value': 3931}, {'value': 8849}, {'value': 1252}, {'value': 4015}, {'value': 964}, {'value': 3462}, {'value': 570}, {'value': 4648}, {'value': 1837}]}
{'status': '1', 'state': 'success', 'data': [{'value': 4681}, {'value': 1877}, {'value': 1445}, {'value': 9637}, {'value': 3533}, {'value': 7989}, {'value': 9799}, {'value': 2936}, {'value': 6645}, {'value': 5039}]}
233373