(event, context)
| 136 | |
| 137 | # 兼容云函数 |
| 138 | def main_handler(event, context): |
| 139 | global lists |
| 140 | for each in lists: |
| 141 | if all(each.values()): |
| 142 | if checkHT(each): |
| 143 | checkInEarly = CheckInEarly(each) |
| 144 | for count in range(3): |
| 145 | try: |
| 146 | time.sleep(random.randint(2,5)) # 随机延时 |
| 147 | checkInEarly.start() |
| 148 | break |
| 149 | except requests.exceptions.ConnectionError: |
| 150 | notify(f"{checkInEarly.dic['user']}\t请求失败,随机延迟后再次访问") |
| 151 | time.sleep(random.randint(2,5)) |
| 152 | continue |
| 153 | else: |
| 154 | notify(f"账号: {checkInEarly.dic['user']}\n状态: 取消登录\n原因: 多次登录失败") |
| 155 | break |
| 156 | if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList: |
| 157 | send('欢太早睡打卡',allMess) |
| 158 | |
| 159 | if __name__ == '__main__': |
| 160 | main_handler(None,None) |
no test coverage detected