Git Product home page Git Product logo

s3s's Introduction

s3s 🦑

s3s is a script that uploads Splatoon 3 battle data from the SplatNet 3 service (part of the Nintendo Switch Online app) to stat.ink, a site for recording, visualizing, and aggregating statistics from the Splatoon series of games.

(ja) 日本語版セットアップ手順はこちら、またはこちら

(ko) 한국어 가이드는 여기를 참조해 주세요.

Looking to track your Splatoon 2 gameplay? See splatnet2statink.

Features

  • Full automation of SplatNet token generation via user log-in
  • Ability to parse & upload complete battle/job stats to stat.ink (example profile)
  • Support for Salmon Run Next Wave and Big Run
  • Support for Splatfest & Tricolor Turf War battles and Challenges
  • Monitoring for new results in real-time & checking for missing/unuploaded results
  • Flag to remove other players' names from results
  • Support for all available game languages
  • File exporting function for use with Lean's seed checker tools
  • Modular design to support IkaLog3 and other tools

What's coming?

  • Easier setup via downloadable, pre-packaged program executables (soon!)

Usage 🐙

$ python s3s.py [-M [N]] [-r] [-nsr | -osr] [--blackout]

The -M flag runs the script in monitoring mode, uploading new matches as you play, checking for new results every N seconds; if no N is provided, it defaults to 300 (5 minutes).

The -r flag checks for & uploads any battles/jobs present on SplatNet 3 that haven't yet been uploaded.

The -nsr flag makes Salmon Run jobs not be monitored/uploaded. Use this if you're playing Lobby modes only.

The -osr flag, conversely, makes only Salmon Run jobs be monitored/uploaded. Use this if you're playing at Grizzco only.

The --blackout flag removes other players' names from uploaded scoreboard data.

Arguments for advanced usage (e.g. locally exporting data to JSON files, use with with Lean's seed checker tools) can be viewed using --help.

Tips for using s3s

On first run, you'll want to use the -r flag to upload all available data from SplatNet to stat.ink, i.e. up to 250 battles (50 of each type: Turf War, Anarchy, X, Challenge, and Private) and up to 50 recent Salmon Run jobs.

The suggested usage of s3s is in monitoring mode, where you run the script as you play the game and exit it once you're done playing. The command python s3s.py -r -M first looks to ensure there's no data missing from stat.ink (uploading it if so), and then continues in monitoring mode while checking for new results every 5 minutes.

More specific use cases can be specified using other flags (and config keys). For example, if you're solely playing Salmon Run and only want to check for new results every 15 minutes, you would use python s3s.py -osr -M 900. If not using monitoring mode, python s3s.py -r should be run at least once every 50 matches to ensure no data is lost.

Setup instructions 🔰

  1. Download and install Python 3. On Windows, grab the latest release from Python.org and check the option during setup to add it to your PATH. On macOS, install Homebrew and run brew install python from Terminal. Run python --version to verify the installation.

  2. If you're on Windows, install Git (pre-installed on macOS and Linux).

  3. Download the script from the command line (macOS: Terminal; Windows: Command Prompt/PowerShell) by running git clone https://github.com/frozenpandaman/s3s.git.

  4. Navigate to the newly-created directory (type cd s3s/) and install the required Python libraries by running pip install -r requirements.txt. On Windows, you may have to use python -m pip instead.

  5. Running the script for the first time (see the "Usage" section above ) will prompt you to enter your stat.ink API Token (available in settings). If you're playing the game in a language other than English, you may enter your language code (locale) as well.

NOTE: Read the "Token generation" section below before proceeding.

  1. You will then be asked to navigate to a specific URL on Nintendo.com, log in, and follow simple instructions to obtain your session_token; this will be used to generate a gtoken and bulletToken. If you are opting against automatic token generation, enter "skip" for this step, at which point you will be asked to manually input your two tokens instead (see the mitmproxy instructions).

    These tokens (used to access your SplatNet battle results) along with your stat.ink API key & language will be saved into config.txt for you. You're now ready to upload battles!

Have any questions, problems, or suggestions? Create an issue here or contact me on Twitter. Please do not raise issues via Discord. It is important for discussion on the internet to be public, indexable, and searchable, able to be shared freely and benefit others – not locked behind a private platform. Here's a great article about this!

質問があれば、ツイッター(@frozenpandaman)で連絡してください。日本語OK。

Accessing SplatNet 3 from your browser

If you wish to access SplatNet 3 from your computer rather than via the NSO phone app, or if you don't have a smartphone, follow this s3s wiki article to enable the use of SplatNet in-browser.

SplatNet 3 can be used in any available game language. You can even enter QR codes on the web version of the app via the list of available ones here!

Splatoon 3 stage rotation information, Splatfest data, and current SplatNet gear are viewable at splatoon3.ink.

Token generation 🪙

For s3s to work, tokens known as gtoken and bulletToken are needed to access SplatNet. These tokens may be obtained automatically, using the script, or manually via the official Nintendo Switch Online app. Please read the following sections carefully to decide whether or not you want to use automatic token generation.

Automatic

Automatic token generation involves making a secure request to a non-Nintendo server with minimal, non-identifying information. We aim to be 100% transparent about this and provide in-depth information on security and privacy. Users who feel uncomfortable with this may opt to manually acquire their tokens instead.

Privacy statement: No identifying information is ever sent to the imink API. Usernames and passwords are far removed from where the API comes into play and are never readable by anyone but you, and returned values do not contain any meaningful information about your account. It is not possible to use either sent or stored data to identify which account/user performed a request, to view identifying information about a user, or to gain access to an account. See the imink API Privacy Policy and Documentation for more information.

Alternatively, you can use nsotokengen or nxapi-znca-api as a drop-in replacement (customizable in config.txt) to generate tokens locally, i.e. without calls to a third-party API.

Manual

Users who decide against using automatic token generation may instead retrieve tokens manually via SplatNet 3.

In this case, users must obtain tokens from their phone – or an emulator – by intercepting their device's web traffic and entering the tokens into s3s when prompted (or manually adding them to config.txt later). Follow the mitmproxy instructions to obtain your tokens. To opt for manual token entry, type "skip" when prompted to enter the "Select this account" URL.

License & copyleft statement 🏴

s3s is free software licensed under GPLv3. This means that you have freedom – to run, modify, copy, share, and redistribute this work as you see fit, as long as derivative works are also distributed under these same or equivalent terms.

Copyright is a recent, confusing, and often unnecessary human invention. Libraries, for example, predate copyright by thousands of years, and their integral role in the "promotion of science" and "encouragement of learning" was acknowledged even before the first copyright statutes were enacted. If the first human who had the idea of a hammer claimed it as their intellectual property, we wouldn't have gotten very far as a species. Please consider sharing your work openly with the world. (statement adapted from here and here)

While this is a free/libre and open-source project, its license does require attribution. If you are using any part of s3s, splatnet2statink, iksm.py, etc. in your project, please provide a link back to this repository. I have spent over half a decade and hundreds of hours of my personal time on these projects for the Splatoon community – so, at the least, some credit would be nice. :) Donations, via the "Sponsor" button at the top or links in the sidebar, are also greatly appreciated. Thank you, and stay fresh! –eli <コ:彡

s3s's People

Contributors

beanjamin25 avatar bhiaibogf avatar butteredwaffles avatar cafeaulait-cc avatar cake-monotone avatar clovervidia avatar dnskimo avatar fetus-hina avatar frozenpandaman avatar gecko655 avatar inkydragon avatar niyari avatar otofune avatar qjzcj2008 avatar rinsuki avatar strohitv avatar toufool avatar unyacat avatar ydkk avatar zhxie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

s3s's Issues

Using -i flag returns contradictory results

not sure if this is intentional since stat.ink doesn't support splat 3 yet (making an issue anyways just in case it isn't) but attempting to use the -i flag will return an error regardless of if you use an argument or not
PS C:\Users\[User]\3D Objects\s3s> python s3s.py -i s3s v0.0.4 While s3s is in alpha, please update the script regularly via "git pull". usage: s3s.py [-h] [-M [N]] [-r] [-nsr] [-osr] [--blackout] [-t] s3s.py: error: argument -i: expected one argument PS C:\Users\[User]\3D Objects\s3s> python s3s.py -i overview.json s3s v0.0.4 While s3s is in alpha, please update the script regularly via "git pull". Cannot use -i with other arguments. Exiting.

splashtags (ja)

*Not in Splatfest World Premiere

ID Not in First part (en) First part (ja)
    Apprentice かけだしの
    Attention-Seeking 目立ちたがりな
    Blissed-Out ハッピーな
    Chaotic 混沌の
    Chilled-Out 冷静沈着な
    Dandy おいしい
    Dangerous キケンな
    Day-Seizing 今を楽しむ
    Fishy サバよんだ
    Homecoming 帰ってきた
    Ink-Sloshing 塗りたくる
    Inkless インク切れの
    Late-Night 夜ふかしの
    Nice ナイスな
    Nostalgic 久しぶりの
    Orderly 秩序の
    Peppy ピチピチの
    Slapdash 付け焼き刃の
    Spineless 逃げ足の速い
    Splatlandian バンカラな
    Splatoon スプラトゥーンの
    Stormy 荒波の
    Swole ムキムキの
    Third-Gen 三代目
    Unrivaled 無敵の
    Wannabe ヒーローになりたい
    Wicked-Fresh イカした
ID Use Second part (en) Second part (ja)
    Agent 3 3号
    Champ チャンピオン
    Chow Hound 食いしんぼう
    Clock Puncher アルバイター
    Clubgoer パリピ
    Deep Cut Fan すりみ連合ファン
    Fashionista ファッショニスタ
    Maestro 天才
    Monarch 王者
    Octopus タコ
    Office Drone 会社員
    Paradigm 申し子
    Party Lover お祭り好き
    Pop Star アイドル
    Raider 切り込み隊長
    Ringleader 番長
    Rookie ルーキー
    Salmon シャケ
    Sea Creature 魚介類
    Squid Roller イカローラー
    Squid Surger イカノボラー
    Squid イカ
    Student 学生
    Sushi お寿司
    Turf Warrior ナワバリバトル好き
    Youngster 赤ちゃん
    Youth 若者

Crash while preparing result ('rank_before_s_plus')

Hi,
After updating to the latest commit, attempting to use -r crashes with a KeyError for rank_before_s_plus.
The error is below. Thanks!

Checking if there are previously-unuploaded battles/jobs...
Previously-unuploaded battles detected. Uploading now...
Traceback (most recent call last):
File "/home/ry/s3s/s3s.py", line 1253, in
main()
File "/home/ry/s3s/s3s.py", line 1229, in main
check_if_missing(which, True if secs != -1 else False, blackout, test_run)
File "/home/ry/s3s/s3s.py", line 899, in check_if_missing
fetch_and_upload_single_result(id, noun, ismonitoring, isblackout, istestrun)
File "/home/ry/s3s/s3s.py", line 848, in fetch_and_upload_single_result
post_result(result, ismonitoring, isblackout, istestrun)
File "/home/ry/s3s/s3s.py", line 696, in post_result
payload = prepare_battle_result(results[i]["data"], ismonitoring, overview_data)
File "/home/ry/s3s/s3s.py", line 606, in prepare_battle_result
if payload["rank_before_s_plus"]:
KeyError: 'rank_before_s_plus'

Ran into an error

This happened when running the script during the splatfest

image

ran it again but it happened again

Tracking last battle ID?

Is s3s currently tracking the last battle ID and only exporting new battles -- or just dumping the last 50 battles to .json to figure out later?

KeyError: 'vsMode'

I'm getting this error every time i run the script in -r mode. It worked in -i with the local data. I'm not sure if it could have any relation to #25, since both started with this new update. I've already tried deleting config.txt and trying again but it didn't help.

image

s3s does not send some information for private battles

If you play the mode for ranked battles (i.e., SZ, TC, RM or CB) in Private Battles, the information is not sent whether you are knocked out or not.
Judd results (% vs % in TW, count vs count in ranked modes) are not sent either.

Because s3s controls the send of these information whether the mode is REGULAR, FEST or BANKARA.
When the vsMode is PRIVATE, the vsRule must be examined to determine which additional information to use.

image

weird looping issue for some people and/or 9403 invalid token error

Seems only I got this problem, I'll go to check my configuration and try it later or just change to another way to get my token. XD

It seems that I can't intercept the NSO app's web traffic anymore via MITM after updated to the 2.2.0 version on my IOS device, only get Connection Error with the error code 2816-0598, with the same configuration I can intercept other apps' web traffic or the old version(1.11.0) NSO app's web traffic (of course only get Update Required), so I don't think my configuration goes wrong. I guess Nintendo may have done something to the app in the new version to prevent MITM attack.
Maybe now IOS devices isn't a good option for getting token manually. This is the situation I met here. Wonder if anyone would like to test it on their IOS devices to find out whether the NSO app now can't be MITM simply.

Also, I see the requirement in Google Play says the system version needs to be Android 6.0 or higher for the NSO app of the latest version 2.2.0 for now. Maybe the Wiki page for manually get token needs some updates?

Some battle results share UUIDs, thus recognized as duplicates & rejected by stat.ink

I decided to upload all of my locally exported data (using -i) to stat.ink and while a majority of the matches seem to have gone through properly, I noticed a few of them were coming up as already been uploaded one after another. In one instance, it did not seem to upload any match results at all. The command prompt does not seem to raise any other errors in regards to those duplicated entries.

Because of the Splatfest, it was hard for me to exactly cross-reference the matches I played recently vs the matches that have successfully been uploaded to stat.ink because it does not support Splatfest battles yet. However, I played 5 matches of regular Turf Wars after the Splatfest. Upon uploading using -r, it only detected 1 of these matches, and showed the other 4 as being a duplicate.

I am currently running s3s on Windows 10 Version 10.0.19044.2006 with Python 3.10.7 installed through the Windows Command Prompt, without Administrator Access.

I have attached the screenshots of some of the uploads that return with duplicated entries, as well as the JSON files generated with the local export. Screenshots of my recent Turf matches from Splatnet along with the local exported data is also attached.
(Uploaded 2 separate zip files since 1 seemed to exceed Github's limit)
exports(1).zip
exports(2).zip

Exception ignored with I/O redirect on Linux

I'm redirecting stdout and stderr in linux for daemon log purpose and I'm getting this error:

Exception ignored in: <function SquidProgress.__del__ at 0x7f136e9718c8>
Traceback (most recent call last):
  File "s3s.py", line 1022, in __del__
    sys.stdout.write(f"\r{' '*(os.get_terminal_size()[0] - 1)}\r")
OSError: [Errno 25] Inappropriate ioctl for device

Anyway it's seem run and terminate correctly.

Salmon Run

Hello, author. I found Stat.ink currently supports Salmon Run. Although there is no interface to display it, data can be uploaded through the API. For details, you can view Stat.ink's issues
fetus-hina/stat.ink#1128

Weird behavior using -r

After I uploaded all of my exported matches yesterday -r was working as intended and blocking previous battle uploads. But today it has started re-uploading the only 5 turf war matches I played on day 1, while still skipping previously uploaded ranked battles.

UTF-8 AttributeError

s3s/s3s.py

Line 19 in 8dcff70

sys.stdout.reconfigure(encoding='utf-8') # note: please stop using git bash

I got an error from this line.

Traceback (most recent call last):
  File "s3s.py", line 19, in <module>
    sys.stdout.reconfigure(encoding='utf-8') # note: please stop using git bash
AttributeError: '_io.TextIOWrapper' object has no attribute 'reconfigure'

Did a little search and found that upgrading Python to version 3.7 (and above) could be a work-a-round. ( I was running with Python 3.6.7, which I believe is the default version installed on macOS).

Maybe there is no need to fix this, and it's ok to just remind the user to check the python version

NSO app gives error?

After I run mitmweb and setup the proxy on my phone, when I try to use the NSO app it continually gives me the following message:

Please Check
Please sign in to your Nintendo Account again.
Error Code: 2817-0199
(Sign Out)

If I sign out then sign back in again it gives me the same screen. I can't even get to the page where I have the option to access the Splatnet stuff

Edit: I was able to get the automatic method working instead of manual. Not sure why this was happening though.

kill / assist count

kill and assist count seem different between splatoon2 and splatoon3
sp2: kill = kill ,assist = assist
sp3: kill = kill + assist , assist = assist

9403 error from Nintendo

I edit my local version to run at monitor mode, (a feature will be support later?
generate new gtoken occasionally failed and script stop unexpected.

image

Incorrect uuid generation

According to the documentation, the uuid of SALMON RUN should use the whole base64 decode result.

When posting to stat.ink from data obtained from SplatNet, we expect the following method to generate a uuid.
This method IS DIFFERENT with the Battle API.

decode Base64'ed ID from coopHistoryDetail.id ("CoopHistoryDetail-u-..." )
Calc UUIDv5 with namespace f1911910-605e-11ed-a622-7085c2057a9d

$theUUID = uuid_v5(
  base64_decode($history->id),
  uuid_from_string('f1911910-605e-11ed-a622-7085c2057a9d'),
);

From: https://github.com/fetus-hina/stat.ink/wiki/Spl3-API:-Salmon-%EF%BC%8D-Post#splatnet-data-based-uuid

But the entire id is not used in s3s:

s3s/s3s.py

Lines 758 to 759 in 1bcdeda

full_id = utils.b64d(job["id"])
payload["uuid"] = str(uuid.uuid5(utils.SALMON_NAMESPACE, full_id[-52:]))

Keeps crashing

i followed the setup instructions exactly and everything was fine until step 5. after inputting my api key to s3s.py it crashes and doesn't seem to save any data. and now when i try to open it again it still crashes. I deleted everything and redownloaded to try again but that didn't work, any other way to fix this? i'm on windows btw and am trying to use this to access splatnet 3 on my computer

(edit: upon further inspection it seems that the issue is that it won't let me sign in with my nintendo account, is there a way to do so outside of the program?

Error with Exit code 1 while there's no battle/jobs with "-r"

Output:

$ python3 s3s.py -r
Checking if there are previously-unuploaded battles/jobs...
No previously-unuploaded battles found.
Please specify whether you want to upload battle results (-nsr) or Salmon Run jobs (-osr). Exiting.
ERROR: 1

Version:
s3s v0.1.5
Latest commit e3abfda1324beb749e957970c8c1e348dacdf527

Expect:
no battle/jobs need to be uploaded
EXIT successfully with 0

Detail:
I understand that exit code 1 is for warning, but "-r" worked as expect without any errors and users should do nothing with it. Shouldn't it be 0? It looks like I am using a wrong argument and need to try -osr or -nsr instead.

Error: Expecting value: line 1 column 1 (char 0)

I'm not sure whether this issue is because of the splatfest battles, or because of something else, but i keep getting this error:

python3 s3s.py -o
s3s v0.0.4
While s3s is in alpha, please update the script regularly via git pull.

Fetching your JSON files to export locally... this might take a while.
Ran into an error:
Expecting value: line 1 column 1 (char 0)
Please run the script again.

Make Data Language User-selectable

I found that the medal you got, the title on the banner, and some other information the splatnet3 provided are only in plain-text strings form rather than ids. And I looked up the databases from datamining, I don’t think it’s easy to do the i18n process on Stat.ink side for data display.

I think maybe just letting users choose what language their data they want to store and display on Stat.ink would be a better and easier way for everyone. Also, I noticed that the information (like abilities, gear name) of the gears you wear are not provided with their ids, just plain-text strings. Not sure will Stat.ink add support to log and analysis gear as they did in Splatoon2 battle log, I think maybe we could use the URLs of gear pics and ability iconsto extract their hashed filenames as the ids to recognize the gears and the abilities when Stat.ink adds gear log and analysis function. I don’t know if I should at the maintenance of Stat.ink here to discuss the questions above.

In current version, s3s uses the language which returned back from Nintendo API users/me port to fetch data from splatnet3. In a previous issue, I saw some discussions about this, but that time we didn’t come up with a conclusion, only using a modification s3s as a temp method. But after doing this modification, it becomes kind of inconvenient when I need to update my s3s, cuz I must revert the change I made to the codes before updates. I did some tests and maybe can explain the language and country returned from Nintendo API. Here’s my assumption, the language is relevant to which language you use on the Nintendo Account web page, not relevant to your settings on your console. And the country seems to be the "Country/region of residence" setting listed on your Nintendo Account web page. And the Accept-Language header which leads you to the NSO splatnet3 page in your preferred language is depending on the device language setting which you use NSO app on.

I looked into imink API Documentation and found that language and country will be used in generating session token and bulletToken. And the Nintendo Account web page supported language list can't cover all languages that Splatoon 3 and SplatNet 3 supported. So maybe we need to add a new configuration key to store what language users prefer to use and use it to set Accept-Language header in bulletToken generation and GraphQL request in splatnet3.

acc_lang and acc_country not set for manual token input

Hello,

Thank you for putting so much effort and time in this project these days.

I'm getting the following error when I choose to skip the token generation and type the gtoken and bulletToken by myself.

Traceback (most recent call last):
  File "s3s.py", line 865, in <module>
    main()
  File "s3s.py", line 789, in main
    prefetch_checks()
  File "s3s.py", line 166, in prefetch_checks
    gen_new_tokens("blank")
  File "s3s.py", line 210, in gen_new_tokens
    CONFIG_DATA["acc_loc"] = acc_lang + "|" + acc_country
UnboundLocalError: local variable 'acc_lang' referenced before assignment

Probably because acc_lang and acc_country are acquired in iksm.get_gtoken(), but skipped in iksm.enter_tokens()

Uploading to splat.ink using -M while in the middle of a Salmon Run game crashes s3s

Pretty simple bug, and hopefully reproducible. I left s3s v0.1.6 running with python s3s.py -M -r and it crashed with this Traceback when it tried uploading my recent battles while I was in a Salmon Run game.

Traceback (most recent call last):
  File "C:\Users\hjtfir\Development\silliness\scripting\s3s\s3s.py", line 1234, in <module>
    main()
  File "C:\Users\hjtfir\Development\silliness\scripting\s3s\s3s.py", line 1213, in main
    monitor_battles(which, secs, blackout, test_run)
  File "C:\Users\hjtfir\Development\silliness\scripting\s3s\s3s.py", line 988, in monitor_battles
    outcome = "Success" if result["job_result"]["is_clear"] == True else "Failure"
KeyError: 'job_result'

[Bug] About the dress skills when synchronizing to stat.ink

Hello, author. I used the s3s program just released today. However, I found a problem when using the stat The third small skill in the link is always a question mark, no matter whether the third skill exists in the clothes I wear. I'm sure this is a bug. You can check the game https://stat.ink/ @Sichongzou/spl3/972746be-f968-44b4-8ab5-4bba36612bd7

In this game, the third skill of clothes and shoes I wear is the same as the first two skills, but it always shows that this is a question mark

Existing interface problems

Hello, the author.I have been looking forward to getting a screenshot of my achievements in Statink of Splatonn3. Because the splatnet2statink I used previously supports this, I'm not sure whether you have no development plan in this area or no plan at all in the near future. I saw this in the document in Stat.ink. Emmm, i know this may be troublesome, but please try your best to improve it.
image
You can find this document here https://github.com/fetus-hina/stat.ink/wiki/Spl3-API:-Post-v3-battle#player-structure

Picture similar to
image

Maybe my translation software is not perfect, but I know you definitely know what I'm talking about. haha

Stat.ink new adaptation

Hello, author, I don't know if you noticed that Stat.ink had a data update three days ago, which supports uploading clothing information in the battle to Stat Ink I don't know whether you will adapt to this update. You can browse the details https://blog.fetus.jp/202211/961.html

Prompt to enter tokens twice in manual token entry mode

Hello,

I got another minor issue. The program prompt to enter tokens twice when I choose to enter gtoken and bulletToken manually. See the following output:

$ python s3s.py -o
s3s v0.0.2
Auto-update is not yet implemented. Please update the script regularly with `git pull`.
Blank token(s).
Please log in to your Nintendo Account to obtain your session_token.

Make sure you have fully read the "Token generation" section of the readme before proceeding. To manually input a token instead, enter "skip" at the prompt below.

Navigate to this URL in your browser:
https://accounts.nintendo.com/connect/1.0.0/authorize?state=...
Log in, right click the "Select this account" button, copy the link address, and paste it below:
skip

You have opted against automatic token generation and must manually input your tokens.

Go to the page below to find instructions to obtain your gtoken and bulletToken:
https://github.com/frozenpandaman/s3s/wiki/mitmproxy-instructions

Enter your gtoken: eyJ0eXAiOiJ...
Enter your bulletToken: -1khKuCAg6...
Using `en-US` for language and `US` for country by default. These can be changed in config.txt.
Wrote tokens to config.txt.

Fetching your JSON files to export locally... this might take a while.
Blank token(s).
Please log in to your Nintendo Account to obtain your session_token.

Make sure you have fully read the "Token generation" section of the readme before proceeding. To manually input a token instead, enter "skip" at the prompt below.

Navigate to this URL in your browser:
https://accounts.nintendo.com/connect/1.0.0/authorize?state=...
Log in, right click the "Select this account" button, copy the link address, and paste it below:
skip

You have opted against automatic token generation and must manually input your tokens.

Go to the page below to find instructions to obtain your gtoken and bulletToken:
https://github.com/frozenpandaman/s3s/wiki/mitmproxy-instructions

Enter your gtoken: eyJ0eXAiOiJ...
Enter your bulletToken: -1khKuCAg6....
Using `en-US` for language and `US` for country by default. These can be changed in config.txt.
Wrote tokens to config.txt.
Created overview.json with general info about your battle and job stats.
Created results.json with detailed recent battles stats (up to 50).
Created coop_results.json with detailed recent Salmon Run job stats (up to 50).

Have fun playing Splatoon 3! :) Bye!

The program says Blank token(s). after the first time I entered my tokens.

The reason is that in prefetch_checks(), SESSION_TOKEN is empty because it's not set in the config.txt file.

So the simple fix is to set CONFIG_DATA["session_token"] as "skip" before writing CONFIG_DATA to file. But I saw your comment in #6, that you are planning to remove the tokens from config file, so I'm not sure whether this fix makes sense to you.

Eliminate mmh3 library dependencies

To use mmh3 on Windows, the C++ code must be built.
As an additional step, a build tool must also be installed.
Generally, Windows does not come with build tools preinstalled.
For this reason, attempts to install the mmh3 library from pip will fail.
This library is used less frequently than play data and is used to export data to other tools. replacing mmh3 with an alternative code would have little impact.

(So I wrote the code to add it to utils.py, but I have no data to verify!)

Exported salmon run JSON doesn't seem to include results in the previous shift

Hi, thank you for releasing s3s with export mode!

I've exported all JSONs, but salmon run JSON seems to include results only in the current shift, not in the previous one.
For instance, I've played 24 times in the 1st shift and 26 times in the 2nd, but JSON files only include the latest 26 results.

This is probably because of these lines in s3s.py:

  			for j in query1_resp["data"]["coopResult"]["historyGroups"]["nodes"][0]["historyDetails"]["nodes"]:
  				job_ids.append(j["id"])

query1_resp["data"]["coopResult"]["historyGroups"]["nodes"] is an array of the number of shifts, and these lines (unintentionally) choose the latest one.

Cannot parse SR weapons exported in non-English when using `-i`

python3 s3s.py -i export-1668657854/coop_results.json export-1668657854/overview.json

upload history jobs, but the files export not in English,
it's result

Error uploading job. Message from server:
{
    "error": {
        "players": "weapons: Weapons is invalid."
    }
}

Exporting without sorting coop_results.json

Hello,

I'm getting a warning when exporting data to local json files: (!) Exporting without sorting coop_results.json

I guess it has something to do with the following code in s3s.py:

if needs_sorted: # put regular, bankara, and private in order, since they were exported in sequential chunks
    try:
        ink_list = [x for x in ink_list if x['data']['vsHistoryDetail'] != None] # just in case
        ink_list = sorted(ink_list, key=lambda d: d['data']['vsHistoryDetail']['playedTime'])
    except:
        print("(!) Exporting without sorting results.json")
    try:
        salmon_list = [x for x in salmon_list if x['data']['vsHistoryDetail'] != None]
        salmon_list = sorted(salmon_list, key=lambda d: d['data']['coopHistoryDetail']['playedTime'])
    except:
        print("(!) Exporting without sorting coop_results.json")

In the second try which sort the salmon run list, should it be x['data']['coopHistoryDetail'] != None instead of vsHistoryDetail ?

v0.1.0 roadmap

I'm not using GitHub's "projects" feature so this is going to sit as an open issue. :D

v0.1.0 roadmap

  • Upload to stat.ink!
  • Get monitoring mode working
  • Get standalone -r working
  • Implement needs_sorted map in fetch_json()
  • Fix bare command (don't get full results, numbers only then necessary GraphQL query/ies)
  • Sort scoreboard (set rank_in_team payload keys)
  • Improved stage shortname display
  • Handle unexplained 9403/9599 errors better (#22)
  • Support for S+ ranks
  • Send medal strings
  • Send agent_variables
  • Send rank_in_team
  • Send rank_exp_change (at end of series, or every open match)
  • Send rank_up_battle (at end of series, or every open match)
  • Send challenge_win and challenge_lose (5 wins/3 losses progress – only at end of series)
  • Retry on stat.ink Cloudflare issue (#23 & #24)
  • Fix rank_before & rank_after params
  • Sort battles (by timestamp) from exported JSONs on upload

Send series progress for every battle

s3s/s3s.py

Lines 622 to 629 in ab0b8b3

if idx == 0: # for the last battle in the series only
# send overall win/lose count
payload["challenge_win"] = parent["bankaraMatchChallenge"]["winCount"]
payload["challenge_lose"] = parent["bankaraMatchChallenge"]["loseCount"]
# send exp change (gain)
if payload["rank_exp_change"] is None:
payload["rank_exp_change"] = parent["bankaraMatchChallenge"]["earnedUdemaePoint"]

Now s3s will only upload challenge progress in the latest game of the series. However this should be able to be calculated using BankaraBattleHistoriesQuery query. I think it's easy to implement if you cache the query correctly.

Example:

https://github.com/spacemeowx2/s3si.ts/blob/24384c2a11bb1e54790069197c3770afc7bb7808/src/app.ts#L158-L173

Here are the uploaded battles:

https://stat.ink/@imspace/spl3/4637289e-3de1-4e7b-9fac-93073de1a118
https://stat.ink/@imspace/spl3/cfb1cb58-3075-43d9-a5b5-ae862f4e40ee
https://stat.ink/@imspace/spl3/90ebdca8-1277-4461-ba1c-118f19943855

allow battles to be sent with invalid (hackers') weapon IDs

image

image

Either we should match against a specific set of invalid/hacked (Grizzco) weapon IDs and blank these out if they occur in a battle JSON, so that the result can still be uploaded to stat.ink without the error above, or stat.ink should change to allow invalid and/or Grizzco weapon IDs being sent.

s3s cannot refresh tokens anymore

Hey, I'm using s3s from a Raspberry Pi on Raspian OS.

Today it stopped working, telling me Got non-JSON response from Nintendo (in api/bullet_tokens step: everytime it has to refresh the tokens. A quick test using Windows worked perfectly fine and if I copy the config.txt with the newly received tokens from Windows to the Raspberry Pi, it works again.

I don't know the cause but it would be nice if you could fix the issue or help me find the reason for it.
(in the image it says Blank tokens, but that's just because I manually removed them in hope it would help)

s3s_windows_vs_linux

KeyError: 'vsHistoryDetail'

Might be related to #26
Using v 0.1.1

When trying to import to stat.ink some local results, I get the following output.
image

python.exe .\s3s.py -i .\export-1663699790\overview.json .\export-1663699790\results.json
s3s v0.1.1
» While s3s is in beta, please update the script regularly via `git pull`.

Traceback (most recent call last):
  File "C:\Users\Dorian\Projects\s3s\s3s.py", line 1173, in <module>
    main()
  File "C:\Users\Dorian\Projects\s3s\s3s.py", line 1119, in main
    if battle["data"]["vsHistoryDetail"] != None:
KeyError: 'vsHistoryDetail'

The two JSON files are in the attached archive for reference.
export-1663699790.zip

This isn't the case for all my results as I was able to successfully import at least one set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.