From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hooks/CaptchaBrotherhood.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'module/plugins/hooks/CaptchaBrotherhood.py') diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 3157fead8..da8fcbafe 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -23,12 +23,15 @@ class CaptchaBrotherhoodException(Exception): def __init__(self, err): self.err = err + def getCode(self): return self.err + def __str__(self): return "" % self.err + def __repr__(self): return "" % self.err @@ -55,6 +58,7 @@ class CaptchaBrotherhood(Hook): def setup(self): self.info = {} + def getCredits(self): response = getURL(self.API_URL + "askCredits.aspx", get={"username": self.getConfig("username"), "password": self.getConfig("passkey")}) @@ -66,6 +70,7 @@ class CaptchaBrotherhood(Hook): self.info['credits'] = credits return credits + def submit(self, captcha, captchaType="file", match=None): try: img = Image.open(captcha) @@ -116,6 +121,7 @@ class CaptchaBrotherhood(Hook): raise CaptchaBrotherhoodException("No solution received in time") + def get_api(self, api, ticket): response = getURL("%s%s.aspx" % (self.API_URL, api), get={"username": self.getConfig("username"), @@ -126,6 +132,7 @@ class CaptchaBrotherhood(Hook): return response + def newCaptchaTask(self, task): if "service" in task.data: return False @@ -147,10 +154,12 @@ class CaptchaBrotherhood(Hook): else: self.logInfo(_("Your CaptchaBrotherhood Account has not enough credits")) + def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: response = self.get_api("complainCaptcha", task.data['ticket']) + def processCaptcha(self, task): c = task.captchaFile try: -- cgit v1.2.3