From 584ddc13830c34a42198b29ddaf90584d611bfb6 Mon Sep 17 00:00:00 2001 From: redV0ID Date: Fri, 27 Oct 2017 21:44:51 +0700 Subject: [PATCH] finish captcha_handler(needs test) --- python3_anticaptcha/NoCaptchaTask.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python3_anticaptcha/NoCaptchaTask.py b/python3_anticaptcha/NoCaptchaTask.py index 1f11c53..ade720b 100644 --- a/python3_anticaptcha/NoCaptchaTask.py +++ b/python3_anticaptcha/NoCaptchaTask.py @@ -49,6 +49,15 @@ class NoCaptchaTask: else: return captcha_id + # Ждем решения капчи time.sleep(self.sleep_time) while True: - pass \ No newline at end of file + captcha_response = requests.post(get_result_url, json=self.result_payload) + + if captcha_response.json()["errorId"] == 0: + if captcha_response.json()["status"] == "processing": + time.sleep(self.sleep_time) + else: + return captcha_response.json() + else: + return captcha_response.json() \ No newline at end of file