From 2aa962ce45239ef2dad4cc8575909b6d6c83ac24 Mon Sep 17 00:00:00 2001 From: eli fessler Date: Sat, 8 Oct 2022 12:52:24 -1000 Subject: [PATCH 1/3] expect alphanumeric splashtag numbers (fetus-hina/stat.ink#1113) --- s3s.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s3s.py b/s3s.py index ac4fda4..b3826fe 100644 --- a/s3s.py +++ b/s3s.py @@ -343,7 +343,7 @@ def set_scoreboard(battle): p_dict["me"] = "yes" if player["isMyself"] else "no" p_dict["name"] = player["name"] try: - p_dict["number"] = player["nameId"] # splashtag number + p_dict["number"] = str(player["nameId"]) # splashtag # - can contain alpha chars too... (why!!!) except KeyError: # may not be present if first battle as "Player" pass p_dict["splashtag_title"] = player["byname"] # splashtag title @@ -366,7 +366,7 @@ def set_scoreboard(battle): p_dict["me"] = "no" p_dict["name"] = player["name"] try: - p_dict["number"] = player["nameId"] + p_dict["number"] = str(player["nameId"]) except: pass p_dict["splashtag_title"] = player["byname"] From c872b4582189b96b84192571cc4acd44d2097781 Mon Sep 17 00:00:00 2001 From: eli fessler Date: Sat, 8 Oct 2022 12:54:35 -1000 Subject: [PATCH 2/3] improve non-json error handling --- iksm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iksm.py b/iksm.py index 24f9c23..6371c21 100644 --- a/iksm.py +++ b/iksm.py @@ -320,7 +320,8 @@ def get_bullet(web_service_token, web_view_ver, app_user_agent, user_lang, user_ bullet_resp = json.loads(r.text) bullet_token = bullet_resp["bulletToken"] except (json.decoder.JSONDecodeError, TypeError): - print("Got non-JSON response from Nintendo.") + print("Got non-JSON response from Nintendo (in api/bullet_tokens step:") + print(bullet_resp) sys.exit(1) except: print("Error from Nintendo (in api/bullet_tokens step):") From c1f22a39a18caca0ecd9c7ed4931b5e9301c5712 Mon Sep 17 00:00:00 2001 From: eli fessler Date: Sat, 8 Oct 2022 12:59:01 -1000 Subject: [PATCH 3/3] update requirements.txt to align with 96dc1b4 --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e5097e7..1c07cbb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ beautifulsoup4 msgpack_python packaging -Pillow requests