-
splatnet3_scraper.auth.NSO.get_bullet_token(gtoken, user_info, user_agent=
None) Given the
gtokenand user information, send a request to SplatNet 3 to obtain the bullet token. This token is required to make any requests to SplatNet 3, and is valid for 6 hours and 30 minutes after it is obtained.The gtoken is obtained by calling
get_gtokenand the user information is obtained by callingget_user_info. The user information must contain the keyslanguage,birthday, andcountryand must align with the values set in the user’s Nintendo account. The user agent is optional, and if not provided, the default user agent will be used. It is not recommended to change the user agent from the default unless you know what you are doing.- Parameters:¶
- gtoken : str¶
GameWebToken, also known as gtoken. Given by Nintendo. This token is required to make any requests to Nintendo Switch Online services and is valid for 2 hours after it is obtained.
- user_info : dict¶
Dictionary containing the user’s information. This must contain the keys
language,birthday, andcountryand must align with the values set in the user’s Nintendo account. These values are verified by Nintendo, so if they do not align, no bullet token will be generated.- user_agent : str | None¶
User agent to use for the request. This is optional, and if not provided, the default user agent will be used. It is not recommended to change the user agent from the default unless you know what you are doing. The default user agent can be found in
constants.pyasDEFAULT_USER_AGENT. Defaults to None.
- Raises:¶
SplatNetException – Error 401,
ERROR_INVALID_GAME_WEB_TOKEN. This indicates that the gtoken is invalid. This can happen if the gtoken is expired or if the provided gtoken was never valid.SplatNetException – Error 403
ERROR_OBSOLETE_VERSION. This indicates that the version provided in request header keyX-Web-View-Veris outdated. This can happen if the version provided is too old.SplatNetException – Error 204,
USER_NOT_REGISTERED. This indicates that there is no game user associated with Splatoon 3, and that the user must play at least one match of Splatoon 3 before using this library.NintendoException – If the request does not fail with one of the above errors, this indicates that the request failed for some other reason and this exception will be raised to indicate that the request failed silently.
- Returns:¶
str – The bullet token. This token is required to make any requests to SplatNet 3, and is valid for 6 hours and 30 minutes after it is obtained.