ExpertDecoders.py 文件源码

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

项目:download-manager 作者: thispc 项目源码 文件源码
def _process_captcha(self, task):
        task.data['ticket'] = ticket = uuid.uuid4()
        result = None

        with open(task.captchaFile, 'rb') as f:
            data = f.read()

        req = get_request()
        #: Raise timeout threshold
        req.c.setopt(pycurl.LOW_SPEED_TIME, 80)

        try:
            result = self.load(self.API_URL,
                               post={'action': "upload",
                                     'key': self.config.get('passkey'),
                                     'file': base64.b64encode(data),
                                     'gen_task_id': ticket},
                               req=req)
        finally:
            req.close()

        self.log_debug("Result %s : %s" % (ticket, result))
        task.setResult(result)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号