From d945b91a9d93eaeeb6a8321e30e7b607e8a4c4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Mon, 28 Aug 2023 20:21:25 +0800 Subject: [PATCH] :bug: Fix the missing `account_id` field when setting the Cookies --- plugins/account/cookies.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/account/cookies.py b/plugins/account/cookies.py index b293e7c..06dec98 100644 --- a/plugins/account/cookies.py +++ b/plugins/account/cookies.py @@ -138,10 +138,18 @@ class AccountCookiesPlugin(Plugin.Conversation): await asyncio.sleep(10) try: if game_token := await client.check_login_qrcode(ticket): - cookies = {"stuid": str(client.account_id), "ltuid": str(client.account_id)} - cookies["stoken"], cookies["mid"] = await client.get_stoken_v2_and_mid_by_game_token(game_token) - cookies["cookie_token"] = await client.get_cookie_token_by_stoken() - cookies["ltoken"] = await client.get_ltoken_by_stoken() + stoken_v2, mid = await client.get_stoken_v2_and_mid_by_game_token(game_token) + cookie_token = await client.get_cookie_token_by_stoken() + ltoken = await client.get_ltoken_by_stoken() + cookies = { + "stuid": str(client.account_id), + "ltuid": str(client.account_id), + "account_id": str(client.account_id), + "stoken": stoken_v2, + "mid": mid, + "cookie_token": cookie_token, + "ltoken": ltoken, + } account_cookies_plugin_data.cookies = cookies return await self.check_cookies(update, context) except SimnetBadRequest as e: