From dcb1894e0c708df0677187355c6743c08ac44c26 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 31 May 2011 20:36:19 +0200 Subject: fixed positional captchas + availbillity over thrift --- module/plugins/crypter/ShareLinksBiz.py | 5 +++-- module/plugins/hooks/CaptchaTrader.py | 3 +++ module/plugins/hooks/IRCInterface.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 407d2ff56..fef10b7f1 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -106,10 +106,11 @@ class ShareLinksBiz(Crypter): # Resolve captcha href = self._resolveCoords(coords, captchaMap) - if href == None: + if href is None: self.log.debug("%s: Invalid captcha resolving, retrying" % self.__name__) self.invalidCaptcha() - self.wait(5) + self.setWait(5, False) + self.wait() self.retry() url = self.baseUrl + href self.html = self.load(url) diff --git a/module/plugins/hooks/CaptchaTrader.py b/module/plugins/hooks/CaptchaTrader.py index 985288090..88b928a50 100644 --- a/module/plugins/hooks/CaptchaTrader.py +++ b/module/plugins/hooks/CaptchaTrader.py @@ -101,6 +101,9 @@ class CaptchaTrader(Hook): raise CaptchaTraderException(response[1]) def newCaptchaTask(self, task): + if not task.isTextual(): + return False + if not self.getConfig("username") or not self.getConfig("passkey"): return False diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 0142c3610..6fdb7622f 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -81,7 +81,7 @@ class IRCInterface(Thread, Hook): pass def newCaptchaTask(self, task): - if self.getConfig("captcha"): + if self.getConfig("captcha") and task.isTextual(): task.handler.append(self) task.setWaiting(60) -- cgit v1.2.3