diff --git a/iksm.py b/iksm.py index 8492f99..92c85c2 100644 --- a/iksm.py +++ b/iksm.py @@ -306,7 +306,6 @@ def get_bullet(web_service_token, web_view_ver, app_user_agent, user_lang, user_ } url = "https://api.lp1.av5ja.srv.nintendo.net/api/bullet_tokens" r = requests.post(url, headers=app_head, cookies=app_cookies) - bullet_resp = json.loads(r.text) if r.status_code == 401: print("Unauthorized error (ERROR_INVALID_GAME_WEB_TOKEN). Cannot fetch tokens at this time.") @@ -317,13 +316,14 @@ def get_bullet(web_service_token, web_view_ver, app_user_agent, user_lang, user_ elif r.status_code == 204: # No Content, USER_NOT_REGISTERED print("Cannot access SplatNet 3 without having played online.") sys.exit(1) - else: - try: - bullet_token = bullet_resp["bulletToken"] - except: - print("Error from Nintendo (in api/bullet_tokens step):") - print(json.dumps(bullet_resp, indent=2)) - sys.exit(1) + + bullet_resp = json.loads(r.text) + try: + bullet_token = bullet_resp["bulletToken"] + except: + print("Error from Nintendo (in api/bullet_tokens step):") + print(json.dumps(bullet_resp, indent=2)) + sys.exit(1) return bullet_token