python-anticaptcha
python-anticaptcha copied to clipboard
Cannot Report Incorrect Captcha Result
raise AnticaptchaException(
python_anticaptcha.exceptions.AnticaptchaException: [ERROR_NO_SUCH_CAPCHA_ID:16]Task you are requesting does not exist in your current task list or has been expired. Could not find appropriate task, make sure it had no errors and you have not reported it yet.
getting this whenever I try to report an incorrect captcha response, even before 60 seconds of task creation. please help
Could you provide any snippet to attempt to reproduce your issue?
I am trying to test the reporting
import passwords
from python_anticaptcha import AnticaptchaClient, ImageToTextTask, AnticatpchaException
def setImg_getCaptcha(captcha):
#anticaptcha service
api_key = passwords.apikey_anticaptcha
captcha_fp = open(captcha, 'rb')
client = AnticaptchaClient(api_key)
task = ImageToTextTask(captcha_fp)
job = client.createTask(task)
task_id=job.task_id
job.join()
return job.get_captcha_text(),task_id
def report_incorrect_captcha(task_id):
api_key = passwords.apikey_anticaptcha
client=AnticaptchaClient(api_key)
print('***')
print(task_id)
res=client.reportIncorrectRecaptcha(task_id)
print('***',res)
captcha=CAPTCHA_IMAGE_PATH
result,task_id=setImg_getCaptcha(captcha)
print(result)
if result!=CORRECT_CAPTCHA_TEXT:
report_incorrect_captcha(task_id)
For the captcha type I am trying to solve by anticaptcha I am getting so many incorrect results