(event, context)
| 255 | |
| 256 | # 兼容云函数 |
| 257 | def main_handler(event, context): |
| 258 | global lists |
| 259 | for each in lists: |
| 260 | if all(each.values()): |
| 261 | if checkHT(each): |
| 262 | battleForHeyTap = BattleForHeyTap(each) |
| 263 | for count in range(3): |
| 264 | try: |
| 265 | time.sleep(random.randint(2,5)) # 随机延时 |
| 266 | battleForHeyTap.start() |
| 267 | break |
| 268 | except requests.exceptions.ConnectionError: |
| 269 | notify(f"{battleForHeyTap.dic['user']}\t请求失败,随机延迟后再次访问") |
| 270 | time.sleep(random.randint(2,5)) |
| 271 | continue |
| 272 | else: |
| 273 | notify(f"账号: {battleForHeyTap.dic['user']}\n状态: 取消登录\n原因: 多次登录失败") |
| 274 | break |
| 275 | if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList: |
| 276 | send('欢太积分大乱斗',allMess) |
| 277 | |
| 278 | if __name__ == '__main__': |
| 279 | main_handler(None,None) |
no test coverage detected