BypassCaptcha.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:pyload-plugins 作者: pyload 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号