Skip to content

splatnet2statink

clovervidia edited this page Aug 23, 2022 · 2 revisions

Getting splatnet2statink to use nsotokengen to generate f tokens is pretty simple.

If you're running version 1.8.0 or later, iksm.py has been updated to use the imink API rather than the flapg API, so all you have to do is change the address that's used.

Locate call_imink_api in iksm.py. There's a line in there that sends a POST request to https://api.imink.app/f. Just replace that address with http://localhost:8080/f, and you're done.

You might also want to add a confirmation like this right at the start of the function:

if step == 1:
	input("Please ensure that nsotokengen is running, then hit Enter. ")

That's just to serve as a reminder to start nsotokengen before splatnet2statink tries to use it.


If you're running an older version, you have to change a bit more, but it's still pretty simple. You just need to modify two functions in iksm.py.

First, locate get_hash_from_s2s_api, and remove the entire function. It's no longer needed.

Next, locate call_flapg_api, which should be right under get_hash_from_s2s_api. Replace the entire function with this:

def call_flapg_api(id_token, guid, timestamp, hash_type):
	'''Passes in tokens to nsotokengen and fetches the response.'''

	if hash_type == "nso":
		input("Please ensure that nsotokengen is running, then hit Enter. ")

	try:
		response = requests.post("http://localhost:8080/f", headers={"Content-Type": "application/json"}, json={"timestamp": str(timestamp), "request_id": guid, "token": id_token, "hash_method": "1" if hash_type == "nso" else "2"})
	except ConnectionError:
		print("Couldn't reach nsotokengen. Please make sure it is running.")
		sys.exit(1)

	tokens = response.json()
	if "error" in tokens:
		print(f"Error from nsotokengen: {tokens['reason']}")
		sys.exit(1)

	tokens.update({"p1": id_token, "p2": timestamp, "p3": guid})
	return tokens

Once this modification has been made, the next time splatnet2statink has to generate a new f token to authenticate to your account, it will remind you to start nsotokengen, and then it will use it to generate tokens.

Clone this wiki locally