diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-10 00:19:51 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-10 00:19:51 +0100 |
commit | c9e31d875d32de31e54959b82bc35eff2b3e0f3f (patch) | |
tree | 5022eadf2ac5c65ba075f172af873b737310ed66 /module/plugins/hooks/BypassCaptcha.py | |
parent | [Keep2shareCc] Fix account __name__ (diff) | |
download | pyload-c9e31d875d32de31e54959b82bc35eff2b3e0f3f.tar.xz |
Code cosmetics
Diffstat (limited to 'module/plugins/hooks/BypassCaptcha.py')
-rw-r--r-- | module/plugins/hooks/BypassCaptcha.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index b8b55ac63..7e1ea6424 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -53,9 +53,9 @@ class BypassCaptcha(Hook): def getCredits(self): - response = getURL(self.GETCREDITS_URL, post={"key": self.getConfig("passkey")}) + res = getURL(self.GETCREDITS_URL, post={"key": self.getConfig("passkey")}) - data = dict([x.split(' ', 1) for x in response.splitlines()]) + data = dict([x.split(' ', 1) for x in res.splitlines()]) return int(data['Left']) @@ -66,18 +66,18 @@ class BypassCaptcha(Hook): req.c.setopt(LOW_SPEED_TIME, 80) try: - response = req.load(self.SUBMIT_URL, - post={"vendor_key": self.PYLOAD_KEY, - "key": self.getConfig("passkey"), - "gen_task_id": "1", - "file": (FORM_FILE, captcha)}, - multipart=True) + res = req.load(self.SUBMIT_URL, + post={'vendor_key': self.PYLOAD_KEY, + 'key': self.getConfig("passkey"), + 'gen_task_id': "1", + 'file': (FORM_FILE, captcha)}, + multipart=True) finally: req.close() - data = dict([x.split(' ', 1) for x in response.splitlines()]) + data = dict([x.split(' ', 1) for x in res.splitlines()]) if not data or "Value" not in data: - raise BypassCaptchaException(response) + raise BypassCaptchaException(res) result = data['Value'] ticket = data['TaskId'] @@ -88,10 +88,10 @@ class BypassCaptcha(Hook): def respond(self, ticket, success): try: - response = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), + res = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), "cv": 1 if success else 0}) except BadHeader, e: - self.logError(_("Could not send response"), str(e)) + self.logError(_("Could not send response"), e) def newCaptchaTask(self, task): |