2022-07-03 21:26:33 +08:00
|
|
|
from littlepaimon_utils import aiorequests
|
2022-05-03 10:43:50 +08:00
|
|
|
|
|
|
|
# 数据源自微信公众号原神创意工坊
|
|
|
|
headers = {
|
|
|
|
'Host': 'www.youchuang.fun',
|
|
|
|
'Referer': 'https://servicewechat.com/wxce4dbe0cb0f764b3/52/page-frame.html',
|
|
|
|
'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) '
|
|
|
|
'Mobile/15E148 MicroMessenger/8.0.20(0x1800142f) NetType/WIFI Language/zh_CN',
|
|
|
|
'content-type': 'application/json'
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async def get_rate(type: str = 'role'):
|
|
|
|
url = f'https://www.youchuang.fun/gamerole/{type}Rate'
|
|
|
|
json_data = {
|
2022-06-05 01:03:43 +08:00
|
|
|
"version": "2.7"
|
2022-05-03 10:43:50 +08:00
|
|
|
}
|
2022-05-19 18:15:56 +08:00
|
|
|
res = await aiorequests.post(url=url, headers=headers, json=json_data)
|
|
|
|
return res.json()
|
2022-05-03 10:43:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
async def get_formation_rate(layer: int = 1):
|
|
|
|
url = 'https://www.youchuang.fun/gamerole/formationRate'
|
|
|
|
json_data = {
|
2022-06-05 01:03:43 +08:00
|
|
|
"version": "2.7",
|
2022-05-03 10:43:50 +08:00
|
|
|
"layer": layer
|
|
|
|
}
|
2022-05-19 18:15:56 +08:00
|
|
|
res = await aiorequests.post(url=url, headers=headers, json=json_data)
|
|
|
|
return res.json()
|
2022-05-03 10:43:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
async def get_teammates_rate(name: str):
|
|
|
|
url = 'https://www.youchuang.fun/gamerole/teammatesRate'
|
|
|
|
json_data = {
|
|
|
|
"name": name,
|
2022-06-05 01:03:43 +08:00
|
|
|
"version": "2.7"
|
2022-05-03 10:43:50 +08:00
|
|
|
}
|
2022-05-19 18:15:56 +08:00
|
|
|
res = await aiorequests.post(url=url, headers=headers, json=json_data)
|
|
|
|
return res.json()
|
2022-05-03 10:43:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
async def get_weapon_rate(name: str):
|
|
|
|
url = 'https://www.youchuang.fun/gamerole/getWeaponByName'
|
|
|
|
json_data = {
|
|
|
|
"name": name,
|
2022-06-05 01:03:43 +08:00
|
|
|
"version": "2.7"
|
2022-05-03 10:43:50 +08:00
|
|
|
}
|
2022-05-19 18:15:56 +08:00
|
|
|
res = await aiorequests.post(url=url, headers=headers, json=json_data)
|
|
|
|
return res.json()
|