check for outdated f generation API

as nintendo servers now reject api calls from NSO version lower than 2.12.0
This commit is contained in:
Lastorder 2025-04-03 10:24:39 +09:00 committed by GitHub
parent 600a462d83
commit a225794954
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@
import base64, hashlib, json, os, re, sys, urllib
import requests
from bs4 import BeautifulSoup
from packaging import version
USE_OLD_NSOAPP_VER = False # Change this to True if you're getting a "9403: Invalid token." error
@ -56,6 +57,10 @@ def get_nsoapp_version():
NSOAPP_VERSION = ver
if version.parse(NSOAPP_VERSION) < version.parse(NSOAPP_SUPPORTED):
print("f generation API is outdated! check config.txt and change f_gen that supports NSO version >= 2.12.0")
sys.exit(1)
return NSOAPP_VERSION
except: # fallback to apple app store
try:

2
s3s.py
View File

@ -32,7 +32,7 @@ try:
config_file.close()
except (IOError, ValueError):
print("Generating new config file.")
CONFIG_DATA = {"api_key": "", "acc_loc": "", "gtoken": "", "bullettoken": "", "session_token": "", "f_gen": "https://nxapi-znca-api.fancy.org.uk/api/znca"}
CONFIG_DATA = {"api_key": "", "acc_loc": "", "gtoken": "", "bullettoken": "", "session_token": "", "f_gen": "https://nxapi-znca-api.fancy.org.uk/api/znca/f"}
config_file = open(config_path, "w")
config_file.seek(0)
config_file.write(json.dumps(CONFIG_DATA, indent=4, sort_keys=False, separators=(',', ': ')))