正在显示
2 个修改的文件
包含
30 行增加
和
30 行删除
| @@ -77,34 +77,34 @@ class Monitor(callback.CallBack): | @@ -77,34 +77,34 @@ class Monitor(callback.CallBack): | ||
| 77 | cfunc = functools.partial(mfunc, client) | 77 | cfunc = functools.partial(mfunc, client) |
| 78 | setattr(client, fname, cfunc) | 78 | setattr(client, fname, cfunc) |
| 79 | 79 | ||
| 80 | - def change(self, email, password, cookie=None): | ||
| 81 | - limit = 100 | ||
| 82 | - if self.size >= limit: | ||
| 83 | - raise Exception("单台终端登录到达上限,%d个号" % limit) | ||
| 84 | - client = self._get_member(email) | ||
| 85 | - if client: | ||
| 86 | - self.onLoggedIn(client) | ||
| 87 | - return client.info() | ||
| 88 | - else: | ||
| 89 | - try: | ||
| 90 | - if email in self.change_list: | ||
| 91 | - self.onChangEnv(email, 'changeError', f'{email}已经在登录队列中') | ||
| 92 | - return | ||
| 93 | - else: | ||
| 94 | - self.change_list.append(email) | ||
| 95 | - self.onChangEnv(email, 'waiting', '队列中...') | ||
| 96 | - self.changeLock.acquire() | ||
| 97 | - self.changeingIn(email) # 转环境的话清理缓存 | ||
| 98 | - result, email, password, cookie, user_agent = self.selenium_login(email, password, cookie) | ||
| 99 | - if result: | ||
| 100 | - self.onChangSucceed(email, '匹配设备指纹成功', | ||
| 101 | - data={'email': email, 'password': password, 'cookie': cookie}) | ||
| 102 | - except Exception as err: | ||
| 103 | - self.onChangEnv(email, 'changeError', str(err)) | ||
| 104 | - raise err | ||
| 105 | - finally: | ||
| 106 | - self.change_list.remove(email) | ||
| 107 | - self.changeLock.release() | 80 | + # def change(self, email, password, cookie=None): |
| 81 | + # limit = 100 | ||
| 82 | + # if self.size >= limit: | ||
| 83 | + # raise Exception("单台终端登录到达上限,%d个号" % limit) | ||
| 84 | + # client = self._get_member(email) | ||
| 85 | + # if client: | ||
| 86 | + # self.onLoggedIn(client) | ||
| 87 | + # return client.info() | ||
| 88 | + # else: | ||
| 89 | + # try: | ||
| 90 | + # if email in self.change_list: | ||
| 91 | + # self.onChangEnv(email, 'changeError', f'{email}已经在登录队列中') | ||
| 92 | + # return | ||
| 93 | + # else: | ||
| 94 | + # self.change_list.append(email) | ||
| 95 | + # self.onChangEnv(email, 'waiting', '队列中...') | ||
| 96 | + # self.changeLock.acquire() | ||
| 97 | + # self.changeingIn(email) # 转环境的话清理缓存 | ||
| 98 | + # result, email, password, cookie, user_agent = self.selenium_login(email, password, cookie) | ||
| 99 | + # if result: | ||
| 100 | + # self.onChangSucceed(email, '匹配设备指纹成功', | ||
| 101 | + # data={'email': email, 'password': password, 'cookie': cookie}) | ||
| 102 | + # except Exception as err: | ||
| 103 | + # self.onChangEnv(email, 'changeError', str(err)) | ||
| 104 | + # raise err | ||
| 105 | + # finally: | ||
| 106 | + # self.change_list.remove(email) | ||
| 107 | + # self.changeLock.release() | ||
| 108 | 108 | ||
| 109 | def login(self, email, password, cookie=None, user_agent=None, proxy=None): | 109 | def login(self, email, password, cookie=None, user_agent=None, proxy=None): |
| 110 | limit = 100 | 110 | limit = 100 |
-
请 注册 或 登录 后发表评论