- splatnet3_scraper.auth.NSO(session)
Initializes the NSO class. The NSO class contains all the logic and holds all the necessary values to proceed through the login flow.
The
__init__method sets the following internal variables:session: The requests session object that is used to make requests to the Nintendo Switch Online API. This is the only variable that is passed in to the__init__method._state: The internal state variable that is used to obtain the session token. This is a random string that is generated when theNSO.stateproperty is first accessed, and is used to generate the login URL._verifier: The internal verifier variable that is used to obtain the session token. This is a random string that is generated when theNSO.verifierproperty is first accessed, and is used to generate the login URL. The verifier is also used to solve the code challenge, verifying to Nintendo that the user is who they say they are._version: The internal version variable that is used to verify the NSO app version. This is a string that is generated when theNSO.versionproperty is first accessed, and is used to obtain the session token._web_view_version: The internal web view version variable that is used to verify the NSO app version. This is a string that is generated when theNSO.web_view_versionproperty is first accessed, and is used to obtain the session token._session_token: A stored session token. This is required to generate all other tokens and information. This is obtained during the login flow and is valid for 2 years._user_access_token: A stored user access token. This is a token that is obtained during the login flow and is used to obtain the user information._id_token: A stored id token. This is a token that is obtained during the login flow and is used to obtain the gtoken._gtoken: A stored gtoken. This is a token that is obtained during the login flow and is used to obtain the bullet token. It is valid for 6 hours and 30 minutes._user_info: A stored user information dictionary. This is obtained during the login flow and is used to obtain the “f” token._f_token_function: A stored function that is used to obtain the “f” token. This function is set to theget_ftokenmethod by default, and can be set with theset_new_f_token_functionmethod to use a user-defined function if desired.