diff --git a/iksm.py b/iksm.py index 077c5db..864937a 100644 --- a/iksm.py +++ b/iksm.py @@ -89,22 +89,22 @@ def get_web_view_ver(bhead=[], gtoken=""): 'X-Requested-With': 'com.nintendo.znca', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'no-cors', - 'Sec-Fetch-Dest': 'script' + 'Sec-Fetch-Dest': 'script', + 'Referer': SPLATNET3_URL # sending w/o lang, na_country, na_lang params } if bhead: app_head["User-Agent"] = bhead.get("User-Agent") - app_head["Referer"] = bhead.get("Referer") app_head["Accept-Encoding"] = bhead.get("Accept-Encoding") app_head["Accept-Language"] = bhead.get("Accept-Language") main_js_body = requests.get(main_js_url, headers=app_head, cookies=app_cookies) if main_js_body.status_code != 200: - return iksm.WEB_VIEW_VER_FALLBACK + return WEB_VIEW_VER_FALLBACK pattern = r"\b(?P[0-9a-f]{40})\b.*revision_info_not_set\"\),.*?=\"(?P\d+\.\d+\.\d+)" match = re.search(pattern, main_js_body.text) if match is None: - return iksm.WEB_VIEW_VER_FALLBACK + return WEB_VIEW_VER_FALLBACK version, revision = match.group("version"), match.group("revision") ver_string = f"{version}-{revision[:8]}" diff --git a/s3s.py b/s3s.py index 3ed055c..2c07dd0 100644 --- a/s3s.py +++ b/s3s.py @@ -91,7 +91,7 @@ def headbutt(): 'Authorization': f'Bearer {BULLETTOKEN}', # update every time it's called with current global var 'Accept-Language': USER_LANG, 'User-Agent': APP_USER_AGENT, - 'X-Web-View-Ver': iksm.WEB_VIEW_VERSION, + 'X-Web-View-Ver': iksm.get_web_view_ver(), 'Content-Type': 'application/json', 'Accept': '*/*', 'Origin': iksm.SPLATNET3_URL, @@ -108,8 +108,7 @@ def prefetch_checks(printout=False): if printout: print("Validating your tokens...", end='\r') - global WEB_VIEW_VERSION - WEB_VIEW_VERSION = iksm.get_web_view_ver() + iksm.get_web_view_ver() # setup if SESSION_TOKEN == "" or GTOKEN == "" or BULLETTOKEN == "": gen_new_tokens("blank")