summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/ImageTyperz.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-22 19:44:59 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-22 19:47:17 +0200
commit0eb6e7ec4a1144dcca824d8add049787d3da1762 (patch)
treed653f5fe28bb247a3c4fadeca9bf6278d744f929 /module/plugins/hooks/ImageTyperz.py
parentSpare code cosmetics (diff)
downloadpyload-0eb6e7ec4a1144dcca824d8add049787d3da1762.tar.xz
Two space before function declaration
Diffstat (limited to 'module/plugins/hooks/ImageTyperz.py')
-rw-r--r--module/plugins/hooks/ImageTyperz.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py
index b7ee6b105..3eb0acd64 100644
--- a/module/plugins/hooks/ImageTyperz.py
+++ b/module/plugins/hooks/ImageTyperz.py
@@ -17,12 +17,15 @@ class ImageTyperzException(Exception):
def __init__(self, err):
self.err = err
+
def getCode(self):
return self.err
+
def __str__(self):
return "<ImageTyperzException %s>" % self.err
+
def __repr__(self):
return "<ImageTyperzException %s>" % self.err
@@ -51,6 +54,7 @@ class ImageTyperz(Hook):
def setup(self):
self.info = {}
+
def getCredits(self):
response = getURL(self.GETCREDITS_URL, post={"action": "REQUESTBALANCE", "username": self.getConfig("username"),
"password": self.getConfig("passkey")})
@@ -66,6 +70,7 @@ class ImageTyperz(Hook):
self.logInfo(_("Account balance: $%s left") % response)
return balance
+
def submit(self, captcha, captchaType="file", match=None):
req = getRequest()
#raise timeout threshold
@@ -100,6 +105,7 @@ class ImageTyperz(Hook):
return ticket, result
+
def newCaptchaTask(self, task):
if "service" in task.data:
return False
@@ -122,6 +128,7 @@ class ImageTyperz(Hook):
else:
self.logInfo(_("Your %s account has not enough credits") % self.__name__)
+
def captchaInvalid(self, task):
if task.data['service'] == self.__name__ and "ticket" in task.data:
response = getURL(self.RESPOND_URL, post={"action": "SETBADIMAGE", "username": self.getConfig("username"),
@@ -133,6 +140,7 @@ class ImageTyperz(Hook):
else:
self.logError(_("Bad captcha solution received, refund request failed"), response)
+
def processCaptcha(self, task):
c = task.captchaFile
try: