summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-23 00:50:23 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-23 00:50:23 +0200
commit7b67f68c1636014fe02286da71bdc6c13dc3eeee (patch)
treefce6a94fd3091c6f917acafcc53e71bd08097d5c /module/plugins/internal
parent[XFSPAccount] Better HOSTER_URL (diff)
downloadpyload-7b67f68c1636014fe02286da71bdc6c13dc3eeee.tar.xz
Simplify captcha challenge calls
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/CaptchaService.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py
index 11b34755b..a1ec633e8 100644
--- a/module/plugins/internal/CaptchaService.py
+++ b/module/plugins/internal/CaptchaService.py
@@ -29,7 +29,7 @@ class CaptchaService:
html = self.plugin.html
else:
errmsg = "%s html not found" % self.__name__
- self.plugin.fail(errmsg)
+ self.plugin.fail(errmsg) #@TODO: replace all plugin.fail(errmsg) with plugin.error(errmsg) in 0.4.10
raise TypeError(errmsg)
m = re.search(self.KEY_PATTERN, html)
@@ -72,9 +72,7 @@ class ReCaptcha(CaptchaService):
self.plugin.fail(errmsg)
raise TypeError(errmsg)
- m = re.search(self.KEY_PATTERN, html)
- if m is None:
- m = re.search(self.KEY_AJAX_PATTERN, html)
+ m = re.search(self.KEY_PATTERN, html) or re.search(self.KEY_AJAX_PATTERN, html)
if m:
self.key = m.group("KEY")
self.plugin.logDebug("ReCaptcha key: %s" % self.key)