From df6f3fc618f79643b6bb3010244c03d157582e39 Mon Sep 17 00:00:00 2001 From: BlocBlocTheDev <97693441+BlocBlocTheDev@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:31:17 +0200 Subject: [PATCH] Update 0.6.6 --- iksm.py | 4 ++-- s3s.py | 20 +++++++++++++------- utils.py | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/iksm.py b/iksm.py index d4f309d..99fd67f 100644 --- a/iksm.py +++ b/iksm.py @@ -10,9 +10,9 @@ S3S_VERSION = "unknown" NSOAPP_VERSION = "unknown" -NSOAPP_VER_FALLBACK = "2.10.0" +NSOAPP_VER_FALLBACK = "2.10.1" WEB_VIEW_VERSION = "unknown" -WEB_VIEW_VER_FALLBACK = "6.0.0-9f87c815" # fallback for current splatnet 3 ver +WEB_VIEW_VER_FALLBACK = "6.0.0-30a1464a" # 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" diff --git a/s3s.py b/s3s.py index ff4daca..af74c7f 100755 --- a/s3s.py +++ b/s3s.py @@ -11,7 +11,7 @@ from packaging import version import iksm, utils -A_VERSION = "0.6.5.1" +A_VERSION = "0.6.6-docker" DEBUG = False @@ -634,6 +634,12 @@ def prepare_battle_result(battle, ismonitoring, isblackout, overview_data=None): payload["fest_dragon"] = "100x" elif times_battle == "DOUBLE_DRAGON": payload["fest_dragon"] = "333x" + elif times_battle == "CONCH_SHELL_SCRAMBLE": + payload["conch_clash"] = "1x" + elif times_battle == "CONCH_SHELL_SCRAMBLE_10": + payload["conch_clash"] = "10x" + elif times_battle == "CONCH_SHELL_SCRAMBLE_33": # presumed + payload["conch_clash"] = "33x" payload["clout_change"] = battle["festMatch"]["contribution"] payload["fest_power"] = battle["festMatch"]["myFestPower"] # pro only @@ -1375,7 +1381,7 @@ def get_num_results(which): return n -def fetch_and_upload_single_result(hash, noun, isblackout, istestrun): +def fetch_and_upload_single_result(hash_, noun, isblackout, istestrun): '''Performs a GraphQL request for a single vsResultId/coopHistoryDetailId and call post_result().''' if noun in ("battles", "battle"): @@ -1388,7 +1394,7 @@ def fetch_and_upload_single_result(hash, noun, isblackout, istestrun): lang = 'en-US' result_post = requests.post(iksm.GRAPHQL_URL, - data=utils.gen_graphql_body(utils.translate_rid[dict_key], dict_key2, hash), + data=utils.gen_graphql_body(utils.translate_rid[dict_key], dict_key2, hash_), headers=headbutt(forcelang=lang), cookies=dict(_gtoken=GTOKEN)) try: @@ -1396,7 +1402,7 @@ def fetch_and_upload_single_result(hash, noun, isblackout, istestrun): post_result(result, False, isblackout, istestrun) # not monitoring mode except json.decoder.JSONDecodeError: # retry once, hopefully avoid a few errors result_post = requests.post(iksm.GRAPHQL_URL, - data=utils.gen_graphql_body(utils.translate_rid[dict_key], dict_key2, hash), + data=utils.gen_graphql_body(utils.translate_rid[dict_key], dict_key2, hash_), headers=headbutt(forcelang=lang), cookies=dict(_gtoken=GTOKEN)) try: @@ -1407,7 +1413,7 @@ def fetch_and_upload_single_result(hash, noun, isblackout, istestrun): print("Error uploading one of your battles. Continuing...") pass else: - print("Error uploading one of your battles. Please try running s3s again.") + print(f"(!) Error uploading one of your battles. Please try running s3s again. This may also be an error on Nintendo's end. See https://github.com/frozenpandaman/s3s/issues/189 for more info. Use the `errors_pass_silently` config key to skip this {noun} and continue running the script.") sys.exit(1) @@ -2044,8 +2050,8 @@ def main(): results = results[:n] # limit to n uploads results.reverse() # sort from oldest to newest noun = utils.set_noun(which) - for hash in results: - fetch_and_upload_single_result(hash, noun, blackout, test_run) # not monitoring mode + for hash_ in results: + fetch_and_upload_single_result(hash_, noun, blackout, test_run) # not monitoring mode thread_pool.shutdown(wait=True) diff --git a/utils.py b/utils.py index 553159d..0abae48 100644 --- a/utils.py +++ b/utils.py @@ -29,7 +29,7 @@ 'XBattleHistoriesQuery': 'eb5996a12705c2e94813a62e05c0dc419aad2811b8d49d53e5732290105559cb', # blank (query1) 'EventBattleHistoriesQuery': 'e47f9aac5599f75c842335ef0ab8f4c640e8bf2afe588a3b1d4b480ee79198ac', # blank (query1) 'VsHistoryDetailQuery': '20f88b10d0b1d264fcb2163b0866de26bbf6f2b362f397a0258a75b7fa900943', # vsResultId (query2) - 'CoopHistoryQuery': '0f8c33970a425683bb1bdecca50a0ca4fb3c3641c0b2a1237aedfde9c0cb2b8f', # blank (query1) + 'CoopHistoryQuery': 'e11a8cf2c3de7348495dea5cdcaa25e0c153541c4ed63f044b6c174bc5b703df', # blank (query1) 'CoopHistoryDetailQuery': 'f2d55873a9281213ae27edc171e2b19131b3021a2ae263757543cdd3bf015cc8', # coopHistoryDetailId (query2) 'MyOutfitCommonDataEquipmentsQuery': '45a4c343d973864f7bb9e9efac404182be1d48cf2181619505e9b7cd3b56a6e8' # for lean's seed checker }