forked from SmmServer/NintendoClients
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_smm_login.py
51 lines (38 loc) · 1.32 KB
/
example_smm_login.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from nintendo.nex import backend, authentication, datastoresmm, common
from nintendo.games import SMM
import argparse
import logging
import base64
import time
logging.basicConfig(
format="[%(asctime)s] %(levelname)s: %(message)s",
level=logging.DEBUG,
datefmt="%Y-%m-%d %H:%M:%S")
logger = logging.getLogger(__name__)
parser = argparse.ArgumentParser()
parser.add_argument("-host", default="127.0.0.1")
parser.add_argument("-port", type=int, default=59900)
parser.add_argument("-username", default="guest")
parser.add_argument("-password", default="MMQea3n!fsik")
parser.add_argument("-token", default="token")
args = parser.parse_args()
backend = backend.BackEndClient()
backend.configure(SMM.ACCESS_KEY, SMM.NEX_VERSION)
backend.connect(args.host, args.port)
auth_info = authentication.AuthenticationInfo()
auth_info.token = args.token
auth_info.server_version = SMM.SERVER_VERSION
backend.login(
args.username, args.password,
auth_info, None
)
client = datastoresmm.DataStoreSmmClient(backend.secure_client)
logger.info("sleeping 5 seconds...")
time.sleep(5)
response = client.check_rate_custom_ranking_counter(0)
logger.info("response: {}".format(response))
logger.info("sleeping 5 seconds...")
time.sleep(5)
response = client.check_rate_custom_ranking_counter(0)
logger.info("response: {}".format(response))
backend.close()