From 1eb36743376bb5116d40aa9de2240ccb5747bdea Mon Sep 17 00:00:00 2001 From: YDKK Date: Sun, 11 Sep 2022 13:51:53 +0900 Subject: [PATCH] Fix Content-Length in login request header --- iksm.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iksm.py b/iksm.py index 3e9fa30..3701d8e 100644 --- a/iksm.py +++ b/iksm.py @@ -189,16 +189,6 @@ def get_gtoken(f_gen_url, session_token, ver): user_country = user_info["country"] # get access token - app_head = { - 'X-Platform': 'Android', - 'X-ProductVersion': nsoapp_version, - 'Content-Type': 'application/json; charset=utf-8', - 'Content-Length': '1074', - 'Connection': 'Keep-Alive', - 'Accept-Encoding': 'gzip', - 'User-Agent': 'com.nintendo.znca/' + nsoapp_version + '(Android/7.1.2)', - } - body = {} try: idToken = id_response["id_token"] @@ -222,6 +212,16 @@ def get_gtoken(f_gen_url, session_token, ver): sys.exit(1) body["parameter"] = parameter + app_head = { + 'X-Platform': 'Android', + 'X-ProductVersion': nsoapp_version, + 'Content-Type': 'application/json; charset=utf-8', + 'Content-Length': str(990 + len(f)), + 'Connection': 'Keep-Alive', + 'Accept-Encoding': 'gzip', + 'User-Agent': 'com.nintendo.znca/' + nsoapp_version + '(Android/7.1.2)', + } + url = "https://api-lp1.znc.srv.nintendo.net/v3/Account/Login" r = requests.post(url, headers=app_head, json=body) splatoon_token = json.loads(r.text)