()
| 170 | sys.exit(0) |
| 171 | |
| 172 | def main(): |
| 173 | logger.info("--------------------任务开始--------------------") |
| 174 | result = getVCode(headers) |
| 175 | bg = result['data']['originalImageBase64'] |
| 176 | tg = result['data']['jigsawImageBase64'] |
| 177 | key = result['data']['secretKey'] |
| 178 | token = result['data']['token'] |
| 179 | logger.info(f"本次口令为: {token}") |
| 180 | logger.info(f"本次密钥为: {key}") |
| 181 | time.sleep(1.5) |
| 182 | logger.info("--------------------识别滑块--------------------") |
| 183 | result = ocr(tg,bg) |
| 184 | res = result['result']['target'] |
| 185 | d = (res[0]) |
| 186 | logger.info(f"滑动距离为: {d}") |
| 187 | logger.info("--------------------执行算法--------------------") |
| 188 | aes_str = json.dumps({"x": d, "y": 5}) |
| 189 | data = aes_str.replace(' ', '') |
| 190 | logger.info(f"加密前: {data}") |
| 191 | time.sleep(1.5) |
| 192 | ecdata = aesEncrypt(key, data) |
| 193 | aesDecrypt(key, ecdata) |
| 194 | pointJson = aesEncrypt(key, data) |
| 195 | logger.info(f"加密后: {pointJson}") |
| 196 | logger.info("--------------------校验滑块--------------------") |
| 197 | checkVCode(pointJson, token) |
| 198 | logger.info("--------------------开始签到--------------------") |
| 199 | str = (token + '---' + aes_str) |
| 200 | data = str.replace(' ', '') |
| 201 | ecdata = aesEncrypt(key, data) |
| 202 | aesDecrypt(key, ecdata) |
| 203 | pointJson = aesEncrypt(key, data) |
| 204 | time.sleep(0.5) |
| 205 | check_sign(pointJson) |
| 206 | |
| 207 | if __name__ == '__main__': |
| 208 | for i in range(len(cookies)): |
no test coverage detected