(event, context)
| 426 | |
| 427 | # 兼容云函数 |
| 428 | def main_handler(event, context): |
| 429 | global lists |
| 430 | for each in lists: |
| 431 | if all(each.values()): |
| 432 | if checkHT(each): |
| 433 | taskCenter = TaskCenter(each) |
| 434 | for count in range(3): |
| 435 | try: |
| 436 | time.sleep(random.randint(2,5)) # 随机延时 |
| 437 | taskCenter.start() |
| 438 | break |
| 439 | except requests.exceptions.ConnectionError: |
| 440 | notify(f"{taskCenter.dic['user']}\t请求失败,随机延迟后再次访问") |
| 441 | time.sleep(random.randint(2,5)) |
| 442 | continue |
| 443 | else: |
| 444 | notify(f"账号: {taskCenter.dic['user']}\n状态: 取消登录\n原因: 多次登录失败") |
| 445 | break |
| 446 | if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList: |
| 447 | send('欢太任务中心',allMess) |
| 448 | |
| 449 | if __name__ == '__main__': |
| 450 | main_handler(None,None) |
no test coverage detected