()
| 43 | |
| 44 | |
| 45 | def pass_captcha(): |
| 46 | captcha_url = "https://laowang.vip/captcha/tncode.php" |
| 47 | captcha_params = { |
| 48 | "t": "0.0923756200765189" |
| 49 | } |
| 50 | captcha_response = session.get(captcha_url, params=captcha_params) |
| 51 | |
| 52 | split_captcha(captcha_response) |
| 53 | cut_slide("./slide.png") |
| 54 | sliding_distance = find_location('./slide.png', './bg.png') |
| 55 | |
| 56 | check_url = "https://laowang.vip/captcha/check.php" |
| 57 | check_params = { |
| 58 | "tn_r": sliding_distance |
| 59 | } |
| 60 | check_response = session.get(check_url, params=check_params) |
| 61 | if check_response.text.find('ok') != -1: |
| 62 | return check_response.text |
| 63 | else: |
| 64 | return pass_captcha() |
| 65 | |
| 66 | |
| 67 | def login(): |
no test coverage detected