def submit(self, captcha, captchaType="file", match=None):
req = get_request()
#: Raise timeout threshold
req.c.setopt(pycurl.LOW_SPEED_TIME, 80)
try:
res = self.load(self.SUBMIT_URL,
post={'vendor_key': self.PYLOAD_KEY,
'key': self.config.get('passkey'),
'gen_task_id': "1",
'file': (pycurl.FORM_FILE, captcha)},
req=req)
finally:
req.close()
data = dict(x.split(' ', 1) for x in res.splitlines())
if not data or "Value" not in data:
raise BypassCaptchaException(res)
result = data['Value']
ticket = data['TaskId']
self.log_debug("Result %s : %s" % (ticket, result))
return ticket, result
评论列表
文章目录