classmethod splatnet3_scraper.query.QueryHandler.from_tokens(session_token, gtoken=None, bullet_token=None, *, prefix='')

Creates a new instance of the class using the tokens provided.

Given a session token, a GTOKEN, and a BULLET_TOKEN, this method will create a new instance of the class with all the tokens already set in the Config object. This method is useful if the user already has all the tokens and wants to avoid having to generate them again if possible. If the user does not have all the tokens, they can pass in None for the tokens they do not have and the method will generate the tokens that are missing.

Parameters:
session_token : str

The session token to use. This token must be valid and not expired or revoked. If the token is invalid, the user will not be able to make any queries to the SplatNet 3 API.

gtoken : str | None

The GTOKEN to use. If None, the method will generate a new GTOKEN. Defaults to None.

bullet_token : str | None

The BULLET_TOKEN to use. If None, the method will generate a new BULLET_TOKEN. Defaults to None.

prefix : str

The prefix to use for the configuration options. This is useful if the user wants to use multiple instances of the class with different tokens. Defaults to “SN3S”.

Returns:

QueryHandler – A new instance of the class with all the tokens already set in the Config object.