From 862714446814d0e1f64b8011e531df3d63c8d728 Mon Sep 17 00:00:00 2001 From: niyari Date: Fri, 18 Apr 2025 06:32:28 +0900 Subject: [PATCH 01/13] fix deprecated function. --- s3s.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3s.py b/s3s.py index a1c3904..c31a8e8 100755 --- a/s3s.py +++ b/s3s.py @@ -1878,7 +1878,7 @@ def main(): overview_filename = "overview.json" else: export_dir = os.path.join(cwd, 'exports') - utc_time = datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%SZ') + utc_time = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None).strftime('%Y%m%dT%H%M%SZ') overview_filename = f'overview-{utc_time}.json' if not os.path.exists(export_dir): os.makedirs(export_dir) From 8bb1a1a8b2f08e2cfffc7cb2e323cd3a140d6e9e Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 19 Jun 2025 09:29:44 +0800 Subject: [PATCH 02/13] VsHistoryDetailQuery --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 0abae48..5696423 100644 --- a/utils.py +++ b/utils.py @@ -28,7 +28,7 @@ translate_rid = { 'PrivateBattleHistoriesQuery': 'fef94f39b9eeac6b2fac4de43bc0442c16a9f2df95f4d367dd8a79d7c5ed5ce7', # blank (query1) 'XBattleHistoriesQuery': 'eb5996a12705c2e94813a62e05c0dc419aad2811b8d49d53e5732290105559cb', # blank (query1) 'EventBattleHistoriesQuery': 'e47f9aac5599f75c842335ef0ab8f4c640e8bf2afe588a3b1d4b480ee79198ac', # blank (query1) - 'VsHistoryDetailQuery': '20f88b10d0b1d264fcb2163b0866de26bbf6f2b362f397a0258a75b7fa900943', # vsResultId (query2) + 'VsHistoryDetailQuery': '94faa2ff992222d11ced55e0f349920a82ac50f414ae33c83d1d1c9d8161c5dd', # vsResultId (query2) 'CoopHistoryQuery': 'e11a8cf2c3de7348495dea5cdcaa25e0c153541c4ed63f044b6c174bc5b703df', # blank (query1) 'CoopHistoryDetailQuery': 'f2d55873a9281213ae27edc171e2b19131b3021a2ae263757543cdd3bf015cc8', # coopHistoryDetailId (query2) 'MyOutfitCommonDataEquipmentsQuery': '45a4c343d973864f7bb9e9efac404182be1d48cf2181619505e9b7cd3b56a6e8' # for lean's seed checker From 098c12724f2df9cf6f20a4d2bab093cdb9a213b9 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 19 Jun 2025 09:34:35 +0800 Subject: [PATCH 03/13] WEB_VIEW_VER_FALLBACK --- iksm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iksm.py b/iksm.py index 99fd67f..80b5924 100644 --- a/iksm.py +++ b/iksm.py @@ -12,7 +12,7 @@ S3S_VERSION = "unknown" NSOAPP_VERSION = "unknown" NSOAPP_VER_FALLBACK = "2.10.1" WEB_VIEW_VERSION = "unknown" -WEB_VIEW_VER_FALLBACK = "6.0.0-30a1464a" # fallback for current splatnet 3 ver +WEB_VIEW_VER_FALLBACK = "10.0.0-88706e32" # fallback for current splatnet 3 ver SPLATNET3_URL = "https://api.lp1.av5ja.srv.nintendo.net" GRAPHQL_URL = SPLATNET3_URL + "/api/graphql" F_GEN_URL = "unknown" From c0f2efefda9e4d041aca4520f36785ff710fbe24 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 19 Jun 2025 09:36:16 +0800 Subject: [PATCH 04/13] series_weapon_power_after --- s3s.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/s3s.py b/s3s.py index a1c3904..8648de4 100755 --- a/s3s.py +++ b/s3s.py @@ -677,6 +677,12 @@ def prepare_battle_result(battle, ismonitoring, isblackout, overview_data=None): except: # could be null in historical data pass + if not payload.get("bankara_power_after"): + try: + payload["series_weapon_power_after"] = battle["bankaraMatch"]["weaponPower"] + except: # could be null in historical data + pass + battle_id = base64.b64decode(battle["id"]).decode('utf-8') battle_id_mutated = battle_id.replace("BANKARA", "RECENT") # normalize the ID, make work with -M and -r From 7fcc7922145aa89f98cf9f6e3290fafa64dcff08 Mon Sep 17 00:00:00 2001 From: strohitv Date: Sat, 5 Jul 2025 14:10:54 +0200 Subject: [PATCH 05/13] add --disable-refresh argument --- s3s.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) mode change 100755 => 100644 s3s.py diff --git a/s3s.py b/s3s.py old mode 100755 new mode 100644 index a1c3904..c5d0a27 --- a/s3s.py +++ b/s3s.py @@ -146,6 +146,10 @@ def gen_new_tokens(reason, force=False): print("Cannot access SplatNet 3 without having played online.") sys.exit(0) + if (DISABLE_REFRESH): + print("Exiting because --disable-refresh is active. Bye!") + sys.exit(0) + if SESSION_TOKEN == "": print("Please log in to your Nintendo Account to obtain your session_token.") new_token = iksm.log_in(A_VERSION, APP_USER_AGENT, F_GEN_URL) @@ -1797,6 +1801,8 @@ def parse_arguments(): help="dry run for testing (won't post to stat.ink)") parser.add_argument("--getseed", required=False, action="store_true", help="export JSON for gear & Shell-Out Machine seed checker") + parser.add_argument("--disable-refresh", required=False, default=False, action="store_true", + help="do not refresh tokens; exit when no valid tokens can be found") parser.add_argument("--skipprefetch", required=False, action="store_true", help=argparse.SUPPRESS) return parser.parse_args() @@ -1824,6 +1830,9 @@ def main(): outfile = parser_result.o # output to local files skipprefetch = parser_result.skipprefetch # skip prefetch checks to ensure token validity + global DISABLE_REFRESH + DISABLE_REFRESH = parser_result.disable_refresh # stop application instead of trying to refresh tokens + # setup ####### check_for_updates() @@ -1833,7 +1842,7 @@ def main(): # i/o checks ############ - if getseed and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv: + if getseed and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--no-refresh" not in sys.argv: print("Cannot use --getseed with other arguments. Exiting.") sys.exit(0) From cb3f8388b9b38715220cac22dc597458ccceafc4 Mon Sep 17 00:00:00 2001 From: strohitv Date: Sat, 5 Jul 2025 14:14:56 +0200 Subject: [PATCH 06/13] add --disable-refresh i/o checks to ensure provided command line arguments make sense --- s3s.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s3s.py b/s3s.py index c5d0a27..c40e709 100644 --- a/s3s.py +++ b/s3s.py @@ -1842,7 +1842,7 @@ def main(): # i/o checks ############ - if getseed and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--no-refresh" not in sys.argv: + if getseed and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--disable-refresh" not in sys.argv: print("Cannot use --getseed with other arguments. Exiting.") sys.exit(0) @@ -1854,7 +1854,7 @@ def main(): print("That doesn't make any sense! :) Exiting.") sys.exit(0) - elif outfile and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv: + elif outfile and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--disable-refresh" not in sys.argv: print("Cannot use -o with other arguments. Exiting.") sys.exit(0) From fc5f8cd9fa261c2110f3699363e4bb1cc5b1733e Mon Sep 17 00:00:00 2001 From: strohitv Date: Sat, 5 Jul 2025 14:50:14 +0200 Subject: [PATCH 07/13] add customization of return code for --disable-refresh; rename to --norefresh --- s3s.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/s3s.py b/s3s.py index c40e709..974c182 100644 --- a/s3s.py +++ b/s3s.py @@ -146,9 +146,9 @@ def gen_new_tokens(reason, force=False): print("Cannot access SplatNet 3 without having played online.") sys.exit(0) - if (DISABLE_REFRESH): - print("Exiting because --disable-refresh is active. Bye!") - sys.exit(0) + if (DISABLE_REFRESH_RC is not None): + print(f"Token refresh is not possible because --norefresh is active. Exiting with RC {DISABLE_REFRESH_RC}.") + sys.exit(DISABLE_REFRESH_RC) if SESSION_TOKEN == "": print("Please log in to your Nintendo Account to obtain your session_token.") @@ -1801,8 +1801,8 @@ def parse_arguments(): help="dry run for testing (won't post to stat.ink)") parser.add_argument("--getseed", required=False, action="store_true", help="export JSON for gear & Shell-Out Machine seed checker") - parser.add_argument("--disable-refresh", required=False, default=False, action="store_true", - help="do not refresh tokens; exit when no valid tokens can be found") + parser.add_argument("--norefresh", dest="RC", required=False, nargs="?", action="store", + help="do not refresh tokens; exit with return code RC when no valid tokens can be found (default: RC 0 = no error)", const=0) parser.add_argument("--skipprefetch", required=False, action="store_true", help=argparse.SUPPRESS) return parser.parse_args() @@ -1830,8 +1830,8 @@ def main(): outfile = parser_result.o # output to local files skipprefetch = parser_result.skipprefetch # skip prefetch checks to ensure token validity - global DISABLE_REFRESH - DISABLE_REFRESH = parser_result.disable_refresh # stop application instead of trying to refresh tokens + global DISABLE_REFRESH_RC + DISABLE_REFRESH_RC = parser_result.RC # stop application instead of trying to refresh tokens # setup ####### @@ -1842,7 +1842,7 @@ def main(): # i/o checks ############ - if getseed and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--disable-refresh" not in sys.argv: + if getseed and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--norefresh" not in sys.argv: print("Cannot use --getseed with other arguments. Exiting.") sys.exit(0) @@ -1854,7 +1854,7 @@ def main(): print("That doesn't make any sense! :) Exiting.") sys.exit(0) - elif outfile and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--disable-refresh" not in sys.argv: + elif outfile and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--norefresh" not in sys.argv: print("Cannot use -o with other arguments. Exiting.") sys.exit(0) From cdc6ef6b636405fffb5a06c82a5ee502ca264e77 Mon Sep 17 00:00:00 2001 From: strohitv Date: Sun, 6 Jul 2025 14:33:40 +0200 Subject: [PATCH 08/13] change i/o checks to use a simple regex for --getseed and -o. The addition of --norefresh could create weird situations with wrong behavior with the old check. --- s3s.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s3s.py b/s3s.py index 974c182..106f31d 100644 --- a/s3s.py +++ b/s3s.py @@ -1842,7 +1842,7 @@ def main(): # i/o checks ############ - if getseed and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--norefresh" not in sys.argv: + if getseed and any(re.search("^(--getseed|--skipprefetch|--norefresh|[0-9]*)$", arg) is None for arg in sys.argv[1:]): print("Cannot use --getseed with other arguments. Exiting.") sys.exit(0) @@ -1854,7 +1854,7 @@ def main(): print("That doesn't make any sense! :) Exiting.") sys.exit(0) - elif outfile and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--norefresh" not in sys.argv: + elif outfile and any(re.search("^(-o|--skipprefetch|--norefresh|[0-9]*)$", arg) is None for arg in sys.argv[1:]): print("Cannot use -o with other arguments. Exiting.") sys.exit(0) From 04526053a6548f27087c139d61d52a1f5b352ba3 Mon Sep 17 00:00:00 2001 From: strohitv Date: Sun, 6 Jul 2025 14:35:22 +0200 Subject: [PATCH 09/13] use + instead of * for number phrase in i/o checks --- s3s.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s3s.py b/s3s.py index 106f31d..2c6e982 100644 --- a/s3s.py +++ b/s3s.py @@ -1842,7 +1842,7 @@ def main(): # i/o checks ############ - if getseed and any(re.search("^(--getseed|--skipprefetch|--norefresh|[0-9]*)$", arg) is None for arg in sys.argv[1:]): + if getseed and any(re.search("^(--getseed|--skipprefetch|--norefresh|[0-9]+)$", arg) is None for arg in sys.argv[1:]): print("Cannot use --getseed with other arguments. Exiting.") sys.exit(0) @@ -1854,7 +1854,7 @@ def main(): print("That doesn't make any sense! :) Exiting.") sys.exit(0) - elif outfile and any(re.search("^(-o|--skipprefetch|--norefresh|[0-9]*)$", arg) is None for arg in sys.argv[1:]): + elif outfile and any(re.search("^(-o|--skipprefetch|--norefresh|[0-9]+)$", arg) is None for arg in sys.argv[1:]): print("Cannot use -o with other arguments. Exiting.") sys.exit(0) From 93104326c43ef20d7c48873350f9e2ccd87a5ca1 Mon Sep 17 00:00:00 2001 From: strohitv Date: Sun, 6 Jul 2025 14:57:23 +0200 Subject: [PATCH 10/13] better wording for --norefresh shutdown message --- s3s.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3s.py b/s3s.py index 2c6e982..9928aae 100644 --- a/s3s.py +++ b/s3s.py @@ -147,7 +147,7 @@ def gen_new_tokens(reason, force=False): sys.exit(0) if (DISABLE_REFRESH_RC is not None): - print(f"Token refresh is not possible because --norefresh is active. Exiting with RC {DISABLE_REFRESH_RC}.") + print(f"Token refresh is disabled because --norefresh is active. Exiting with RC {DISABLE_REFRESH_RC}.") sys.exit(DISABLE_REFRESH_RC) if SESSION_TOKEN == "": From bd6053c7cfa085d2377bb7c6dc86616a6e222596 Mon Sep 17 00:00:00 2001 From: strohitv Date: Sun, 6 Jul 2025 23:44:01 +0200 Subject: [PATCH 11/13] add validation for DISABLE_REFRESH_RC and also fix bug that DISABLE_REFRESH_RC was provided as string, causing the script to always exist with RC 1 --- s3s.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/s3s.py b/s3s.py index 9928aae..71b7c9b 100644 --- a/s3s.py +++ b/s3s.py @@ -1830,8 +1830,7 @@ def main(): outfile = parser_result.o # output to local files skipprefetch = parser_result.skipprefetch # skip prefetch checks to ensure token validity - global DISABLE_REFRESH_RC - DISABLE_REFRESH_RC = parser_result.RC # stop application instead of trying to refresh tokens + rc_value = parser_result.RC # stop application instead of trying to refresh tokens # setup ####### @@ -1872,6 +1871,18 @@ def main(): print("Minimum number of seconds in monitoring mode is 60. Exiting.") sys.exit(0) + global DISABLE_REFRESH_RC + DISABLE_REFRESH_RC = None + if rc_value is not None: + try: + DISABLE_REFRESH_RC = int(rc_value) + except ValueError: + print("Number provided for --norefresh must be an integer. Exiting.") + sys.exit(1) + if DISABLE_REFRESH_RC < 0: + print("RC for --norefresh must be 0 or positive! Exiting.") + sys.exit(1) + # export results to file: -o flag ################################# if outfile: From 5cbcd498ccc1565dd42190bcf0724c4c4a22fd98 Mon Sep 17 00:00:00 2001 From: strohitv <45733269+strohitv@users.noreply.github.com> Date: Wed, 6 Aug 2025 23:03:17 +0200 Subject: [PATCH 12/13] Remove --norefresh arg from the s3s --help command --- s3s.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/s3s.py b/s3s.py index a34ee3f..f257b8a 100644 --- a/s3s.py +++ b/s3s.py @@ -1807,8 +1807,7 @@ def parse_arguments(): help="dry run for testing (won't post to stat.ink)") parser.add_argument("--getseed", required=False, action="store_true", help="export JSON for gear & Shell-Out Machine seed checker") - parser.add_argument("--norefresh", dest="RC", required=False, nargs="?", action="store", - help="do not refresh tokens; exit with return code RC when no valid tokens can be found (default: RC 0 = no error)", const=0) + parser.add_argument("--norefresh", dest="RC", required=False, nargs="?", action="store", help=argparse.SUPPRESS, const=0) parser.add_argument("--skipprefetch", required=False, action="store_true", help=argparse.SUPPRESS) return parser.parse_args() From 0fc5254a099ee55df72e371e3ea52cb68bdcf319 Mon Sep 17 00:00:00 2001 From: eli fessler Date: Thu, 7 Aug 2025 06:35:45 +0900 Subject: [PATCH 13/13] bump version number --- s3s.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3s.py b/s3s.py index f257b8a..0d24d1f 100644 --- a/s3s.py +++ b/s3s.py @@ -11,7 +11,7 @@ import requests, msgpack from packaging import version import iksm, utils -A_VERSION = "0.6.7" +A_VERSION = "0.7.0" DEBUG = False