allow easy toggling of old NSO app version headers (#113)

This commit is contained in:
eli fessler 2023-02-28 22:13:40 -10:00
parent d61b0eddd2
commit 5cae35459c
2 changed files with 7 additions and 2 deletions

View File

@ -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)

2
s3s.py
View File

@ -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