From 3ccb93b6980df1ccd7dc2dd5fe686f91df12bca0 Mon Sep 17 00:00:00 2001 From: forchannot <100580891+forchannot@users.noreply.github.com> Date: Thu, 2 May 2024 22:38:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20=E6=9B=B4=E6=96=B0authkey=20ds?= =?UTF-8?q?=20(#506)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝 更新4.6 metadata * ✨ 适配新抽卡记录链接 * 📝 更新authkey ds * 📝 更新authkey ds --- LittlePaimon/utils/api.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/LittlePaimon/utils/api.py b/LittlePaimon/utils/api.py index fa4e723..012f39a 100644 --- a/LittlePaimon/utils/api.py +++ b/LittlePaimon/utils/api.py @@ -106,9 +106,9 @@ def get_old_version_ds(mhy_bbs: bool = False) -> str: 生成米游社旧版本headers的ds_token """ if mhy_bbs: - s = 'N50pqm7FSy2AkFz2B3TqtuZMJ5TOl3Ep' + s = "1OJyMNCqFlstEQqqMOv0rKCIdTOoJhNt" else: - s = 'z8DRIUjNDT7IT5IZXvrUAxyupA1peND9' + s = "AcpNVhfh0oedCobdCyFV8EE1jMOVDy9q" t = str(int(time.time())) r = ''.join(random.sample(string.ascii_lowercase + string.digits, 6)) c = md5(f"salt={s}&t={t}&r={r}") @@ -465,18 +465,18 @@ async def get_authkey_by_stoken( if not cookie_info.stoken: return 'cookie中没有stoken字段,请重新绑定', False, cookie_info headers = { - 'Cookie': cookie_info.stoken, - 'DS': get_old_version_ds(True), - 'User-Agent': 'okhttp/4.8.0', - 'x-rpc-app_version': '2.35.2', - 'x-rpc-sys_version': '12', - 'x-rpc-client_type': '5', - 'x-rpc-channel': 'mihoyo', - 'x-rpc-device_id': random_hex(32), - 'x-rpc-device_name': random_text(random.randint(1, 10)), - 'x-rpc-device_model': 'Mi 10', - 'Referer': 'https://app.mihoyo.com', - 'Host': 'api-takumi.mihoyo.com', + "Cookie": cookie_info.stoken, + "DS": get_old_version_ds(True), + "User-Agent": "okhttp/4.8.0", + "x-rpc-app_version": "2.60.1", + "x-rpc-sys_version": "12", + "x-rpc-client_type": "5", + "x-rpc-channel": "mihoyo", + "x-rpc-device_id": random_hex(32), + "x-rpc-device_name": random_text(random.randint(1, 10)), + "x-rpc-device_model": "Mi 10", + "Referer": "https://app.mihoyo.com", + "Host": "api-takumi.mihoyo.com", } data = await aiorequests.post( url=AUTHKEY_API,