| 220 | |
| 221 | # 兼容云函数 |
| 222 | def main_handler(event, context): |
| 223 | global lists |
| 224 | for each in lists: |
| 225 | if all(each.values()): |
| 226 | if checkHT(each): |
| 227 | otherTask = OtherTask(each) |
| 228 | for count in range(3): |
| 229 | try: |
| 230 | time.sleep(random.randint(2,5)) # 随机延时 |
| 231 | otherTask.start() |
| 232 | break |
| 233 | except requests.exceptions.ConnectionError: |
| 234 | notify(f"{otherTask.dic['user']}\t请求失败,随机延迟后再次访问") |
| 235 | time.sleep(random.randint(2,5)) |
| 236 | continue |
| 237 | else: |
| 238 | notify(f"账号: {otherTask.dic['user']}\n状态: 取消登录\n原因: 多次登录失败") |
| 239 | break |
| 240 | if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList: |
| 241 | send('欢太其它活动',allMess) |
| 242 | |
| 243 | if __name__ == '__main__': |
| 244 | main_handler(None,None) |