Euiseo Cha 852a09137c chore: update dependency | hai 1 ano | |
---|---|---|
.github | %!s(int64=2) %!d(string=hai) anos | |
nso_bridge | %!s(int64=2) %!d(string=hai) anos | |
scripts | %!s(int64=2) %!d(string=hai) anos | |
tests | %!s(int64=2) %!d(string=hai) anos | |
.flake8 | %!s(int64=2) %!d(string=hai) anos | |
.gitignore | %!s(int64=2) %!d(string=hai) anos | |
.isort.cfg | %!s(int64=2) %!d(string=hai) anos | |
LICENSE | %!s(int64=2) %!d(string=hai) anos | |
README.md | %!s(int64=2) %!d(string=hai) anos | |
pyproject.toml | hai 1 ano |
Nintendo Switch Online API bridge (for Nintendo Switch Online API wrapper)
Nintendo Switch Online API Bridge is a simple wrapper. It allows you to easily access the API and get the data you need.
pip install nso-bridge
pip install git+https://github.com/zeroday0619/Nintendo_Switch_Online_API_Bridge.git
Get information of My Nintendo Switch Account.
import json
import keyring
from nso_bridge.nsa import NintendoSwitchAccount
from nso_bridge.nso import NintendoSwitchOnlineAPI
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
app = NintendoSwitchAccount()
# override the nso_app_version
app.nso_app_version = app.get_nso_app_version()
session_token = keyring.get_password("nso-bridge", "session_token")
nso_res = NintendoSwitchOnlineAPI(
nso_app_version=app.nso_app_version,
session_token=session_token,
)
nso_res.sync_login()
print(json.dumps(nso_res.getCurrentUser(), indent=4, ensure_ascii=False))
Get information of friends registered to Nintendo Switch account.
import json
import keyring
from nso_bridge.nsa import NintendoSwitchAccount
from nso_bridge.nso import NintendoSwitchOnlineAPI
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
app = NintendoSwitchAccount()
# override the nso_app_version
app.nso_app_version = app.get_nso_app_version()
session_token = keyring.get_password("nso-bridge", "session_token")
nso_res = NintendoSwitchOnlineAPI(
nso_app_version=app.nso_app_version,
session_token=session_token,
)
nso_res.sync_login()
print(json.dumps(nso_res.getFriends(), indent=4, ensure_ascii=False))