check if contact already requested or not

This commit is contained in:
2022-07-21 14:31:15 +02:00
parent af8b836033
commit a975576e73
4 changed files with 21 additions and 8 deletions
+3 -1
View File
@@ -46,10 +46,12 @@ class SolveCaptcha:
url_response = "http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY,
self.captcha_id)
solution = CAPCHA_NOT_READY
while solution == CAPCHA_NOT_READY:
status_code = 1
while solution == CAPCHA_NOT_READY or status_code != 200:
solution_res = requests.get(url_response)
time.sleep(5)
solution = solution_res.text
self.logger.info("response code: " + str(res.status_code))
status_code = res.status_code
# self.logger.info(solution)
handle_solution_received(solution.split("|")[-1])