(event, context)
| 163 | |
| 164 | # 兼容云函数 |
| 165 | def main_handler(event, context): |
| 166 | global lists |
| 167 | for each in lists: |
| 168 | if all(each.values()): |
| 169 | if checkHT(each): |
| 170 | timingCash = TimingCash(each) |
| 171 | for count in range(3): |
| 172 | try: |
| 173 | time.sleep(random.randint(2,5)) # 随机延时 |
| 174 | timingCash.start() |
| 175 | break |
| 176 | except requests.exceptions.ConnectionError: |
| 177 | notify(f"{timingCash.dic['user']}\t请求失败,随机延迟后再次访问") |
| 178 | time.sleep(random.randint(2,5)) |
| 179 | continue |
| 180 | else: |
| 181 | notify(f"账号: {timingCash.dic['user']}\n状态: 取消登录\n原因: 多次登录失败") |
| 182 | break |
| 183 | if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList: |
| 184 | send('欢太定时现金',allMess) |
| 185 | |
| 186 | if __name__ == '__main__': |
| 187 | main_handler(None,None) |
no test coverage detected