From 5cae35459c4bc987b2e0d73152f02149acf1c09a Mon Sep 17 00:00:00 2001 From: eli fessler Date: Tue, 28 Feb 2023 22:13:40 -1000 Subject: [PATCH] allow easy toggling of old NSO app version headers (#113) --- iksm.py | 7 ++++++- s3s.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/iksm.py b/iksm.py index 1f3da6b..3880778 100644 --- a/iksm.py +++ b/iksm.py @@ -6,6 +6,8 @@ import base64, hashlib, json, os, re, sys, urllib import requests from bs4 import BeautifulSoup +USE_OLD_NSOAPP_VER = True # Change this to True if you're getting a "9403: Invalid token." error + S3S_VERSION = "unknown" NSOAPP_VERSION = "unknown" NSOAPP_VER_FALLBACK = "2.4.0" @@ -26,6 +28,9 @@ session = requests.Session() def get_nsoapp_version(): '''Fetches the current Nintendo Switch Online app version from the Apple App Store and sets it globally.''' + if USE_OLD_NSOAPP_VER: + return NSOAPP_VER_FALLBACK + global NSOAPP_VERSION if NSOAPP_VERSION != "unknown": # already set return NSOAPP_VERSION @@ -308,7 +313,7 @@ def get_gtoken(f_gen_url, session_token, ver): except: print("Error from Nintendo (in Account/Login step):") print(json.dumps(splatoon_token, indent=2)) - print("Re-running the script usually fixes this.") + print("Try re-running the script. Or, if the NSO app has recently been updated, you may temporarily change `USE_OLD_NSOAPP_VER` to True at the top of iksm.py for a workaround.") sys.exit(1) f, uuid, timestamp = call_f_api(id_token, 2, f_gen_url) diff --git a/s3s.py b/s3s.py index 0dbfaa5..efbe2c2 100755 --- a/s3s.py +++ b/s3s.py @@ -11,7 +11,7 @@ import msgpack from packaging import version import iksm, utils -A_VERSION = "0.3.2" +A_VERSION = "0.3.3" DEBUG = False