更新salt

This commit is contained in:
Womsxd 2022-12-31 12:37:23 +08:00
parent b291987a65
commit 16014b46e0
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68
3 changed files with 13 additions and 12 deletions

View File

@ -20,7 +20,7 @@ class Mihoyobbs:
"DS": tools.get_ds(web=False), "DS": tools.get_ds(web=False),
"cookie": f'stuid={config.config["account"]["stuid"]};stoken={config.config["account"]["stoken"]}', "cookie": f'stuid={config.config["account"]["stuid"]};stoken={config.config["account"]["stoken"]}',
"x-rpc-client_type": setting.mihoyobbs_Client_type, "x-rpc-client_type": setting.mihoyobbs_Client_type,
"x-rpc-app_version": setting.mihoyobbs_Version, "x-rpc-app_version": setting.mihoyobbs_version,
"x-rpc-sys_version": "12", "x-rpc-sys_version": "12",
"x-rpc-channel": "miyousheluodi", "x-rpc-channel": "miyousheluodi",
"x-rpc-device_id": tools.get_device_id(), "x-rpc-device_id": tools.get_device_id(),

View File

@ -1,9 +1,10 @@
# 米游社的Salt # 米游社的Salt
mihoyobbs_Salt = "PVeGWIZACpxXZ1ibMVJPi9inCY4Nd4y2" mihoyobbs_salt = "TsmyHpZg8gFAVKTtlPaL6YwMldzxZJxQ"
mihoyobbs_Salt2 = "t0qEgfub6cvueAPgR5m9aQWWVciEer7v" mihoyobbs_salt_x4 = "xV8v4Qu54lUKrEYFZkJhB8cuOh9Asafs"
mihoyobbs_Salt_web = "yUZ3s0Sna1IrSNfk29Vo6vRapdOyqyhB" mihoyobbs_salt_x6 = "t0qEgfub6cvueAPgR5m9aQWWVciEer7v"
mihoyobbs_salt_web = "osgT0DljLarYxgebPPHJFjdaxPfoiHGt"
# 米游社的版本 # 米游社的版本
mihoyobbs_Version = "2.38.1" # Salt和Version相互对应 mihoyobbs_version = "2.41.2" # Salt和Version相互对应
# 米游社的客户端类型 # 米游社的客户端类型
mihoyobbs_Client_type = "2" # 1为ios 2为安卓 mihoyobbs_Client_type = "2" # 1为ios 2为安卓
mihoyobbs_Client_type_web = "5" # 4为pc web 5为mobile web mihoyobbs_Client_type_web = "5" # 4为pc web 5为mobile web
@ -70,9 +71,9 @@ headers = {
'DS': "", 'DS': "",
"x-rpc-channel": "miyousheluodi", "x-rpc-channel": "miyousheluodi",
'Origin': 'https://webstatic.mihoyo.com', 'Origin': 'https://webstatic.mihoyo.com',
'x-rpc-app_version': mihoyobbs_Version, 'x-rpc-app_version': mihoyobbs_version,
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; Unspecified Device) AppleWebKit/537.36 (KHTML, like Gecko) ' 'User-Agent': 'Mozilla/5.0 (Linux; Android 12; Unspecified Device) AppleWebKit/537.36 (KHTML, like Gecko) '
f'Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36 miHoYoBBS/{mihoyobbs_Version}', f'Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36 miHoYoBBS/{mihoyobbs_version}',
'x-rpc-client_type': mihoyobbs_Client_type_web, 'x-rpc-client_type': mihoyobbs_Client_type_web,
'Referer': '', 'Referer': '',
'Accept-Encoding': 'gzip, deflate', 'Accept-Encoding': 'gzip, deflate',

View File

@ -27,9 +27,9 @@ def timestamp() -> int:
# 获取请求Header里的DS 当web为true则生成网页端的DS # 获取请求Header里的DS 当web为true则生成网页端的DS
def get_ds(web: bool) -> str: def get_ds(web: bool) -> str:
if web: if web:
n = setting.mihoyobbs_Salt_web n = setting.mihoyobbs_salt_web
else: else:
n = setting.mihoyobbs_Salt n = setting.mihoyobbs_salt
i = str(timestamp()) i = str(timestamp())
r = random_text(6) r = random_text(6)
c = md5("salt=" + n + "&t=" + i + "&r=" + r) c = md5("salt=" + n + "&t=" + i + "&r=" + r)
@ -38,7 +38,7 @@ def get_ds(web: bool) -> str:
# 获取请求Header里的DS(版本2) 这个版本ds之前见到都是查询接口里的 # 获取请求Header里的DS(版本2) 这个版本ds之前见到都是查询接口里的
def get_ds2(q: str, b: str) -> str: def get_ds2(q: str, b: str) -> str:
n = setting.mihoyobbs_Salt2 n = setting.mihoyobbs_salt_x6
i = str(timestamp()) i = str(timestamp())
r = str(random.randint(100001, 200000)) r = str(random.randint(100001, 200000))
add = f'&b={b}&q={q}' add = f'&b={b}&q={q}'
@ -73,8 +73,8 @@ def get_useragent() -> str:
i = config.config["games"]["cn"]["useragent"].index("miHoYoBBS") i = config.config["games"]["cn"]["useragent"].index("miHoYoBBS")
if config.config["games"]["cn"]["useragent"][i - 1] == " ": if config.config["games"]["cn"]["useragent"][i - 1] == " ":
i = i-1 i = i-1
return f'{config.config["games"]["cn"]["useragent"][:i]} miHoYoBBS/{setting.mihoyobbs_Version}' return f'{config.config["games"]["cn"]["useragent"][:i]} miHoYoBBS/{setting.mihoyobbs_version}'
return f'{config.config["games"]["cn"]["useragent"]} miHoYoBBS/{setting.mihoyobbs_Version}' return f'{config.config["games"]["cn"]["useragent"]} miHoYoBBS/{setting.mihoyobbs_version}'
# 获取Openssl版本 # 获取Openssl版本