MCPcopy
hub / github.com/ZainCheung/netease-cloud / login

Method login

index.py:54–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

52 登录
53 '''
54 def login(self):
55 data = {"uin":self.uin,"pwd":self.pwd,"countrycode":self.countrycode,"r":random.random()}
56 if '@' in self.uin:
57 url = api + '?do=email'
58 else:
59 url = api + '?do=login'
60 response = requests.post(url, data=data, headers={'Content-Type':'application/x-www-form-urlencoded'})
61 code = json.loads(response.text)['code']
62 self.name = json.loads(response.text)['profile']['nickname']
63 self.uid = json.loads(response.text)['account']['id']
64 if code==200:
65 self.error = ''
66 else:
67 self.error = '登录失败,请检查账号'
68 self.cookies = response.cookies.get_dict()
69 self.log('登录成功')
70
71 '''
72 每日签到

Callers 1

startMethod · 0.95

Calls 1

logMethod · 0.95

Tested by

no test coverage detected