summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/CaptchaService.py22
-rw-r--r--module/plugins/internal/SimpleCrypter.py2
-rw-r--r--module/plugins/internal/SimpleHoster.py2
-rw-r--r--module/plugins/internal/XFSPHoster.py4
4 files changed, 15 insertions, 15 deletions
diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py
index 28374899d..6d3fc0feb 100644
--- a/module/plugins/internal/CaptchaService.py
+++ b/module/plugins/internal/CaptchaService.py
@@ -16,7 +16,7 @@ class CaptchaService:
KEY_PATTERN = None
- key = None
+ key = None #: last key detected
def __init__(self, plugin):
@@ -28,7 +28,7 @@ class CaptchaService:
if hasattr(self.plugin, "html") and self.plugin.html:
html = self.plugin.html
else:
- errmsg = "%s html missing" % self.__name__
+ errmsg = "%s html not found" % self.__name__
self.plugin.fail(errmsg)
raise TypeError(errmsg)
@@ -68,7 +68,7 @@ class ReCaptcha(CaptchaService):
if hasattr(self.plugin, "html") and self.plugin.html:
html = self.plugin.html
else:
- errmsg = "ReCaptcha html missing"
+ errmsg = "ReCaptcha not found"
self.plugin.fail(errmsg)
raise TypeError(errmsg)
@@ -86,10 +86,10 @@ class ReCaptcha(CaptchaService):
def challenge(self, key=None):
if not key:
- if self.key:
+ if self.detect_key():
key = self.key
else:
- errmsg = "ReCaptcha key missing"
+ errmsg = "ReCaptcha key not found"
self.plugin.fail(errmsg)
raise TypeError(errmsg)
@@ -129,7 +129,7 @@ class AdsCaptcha(CaptchaService):
if hasattr(self.plugin, "html") and self.plugin.html:
html = self.plugin.html
else:
- errmsg = "AdsCaptcha html missing"
+ errmsg = "AdsCaptcha html not found"
self.plugin.fail(errmsg)
raise TypeError(errmsg)
@@ -144,12 +144,12 @@ class AdsCaptcha(CaptchaService):
return None
- def challenge(self, key=None): #: key is tuple(CaptchaId, PublicKey)
+ def challenge(self, key=None): #: key is a tuple(CaptchaId, PublicKey)
if not key:
- if self.key:
+ if self.detect_key():
key = self.key
else:
- errmsg = "AdsCaptcha key missing"
+ errmsg = "AdsCaptcha key not found"
self.plugin.fail(errmsg)
raise TypeError(errmsg)
@@ -187,10 +187,10 @@ class SolveMedia(CaptchaService):
def challenge(self, key=None):
if not key:
- if self.key:
+ if self.detect_key():
key = self.key
else:
- errmsg = "SolveMedia key missing"
+ errmsg = "SolveMedia key not found"
self.plugin.fail(errmsg)
raise TypeError(errmsg)
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index 2ea8d302b..613ffce1f 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -165,6 +165,6 @@ class SimpleCrypter(Crypter):
#@TODO: remove in 0.4.10
def error(self, reason=None, type="parse"):
- raise Fail("%s error%s | Plugin out of date" % (type.capitalize(), ':' + str(reason) if reason else ""))
+ raise Fail("%s error%s | Plugin out of date" % (type.capitalize(), ': ' + str(reason) if reason else ""))
if self.core.debug:
print_exc()
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 17543ba8d..a8a44d953 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -324,6 +324,6 @@ class SimpleHoster(Hoster):
#@TODO: remove in 0.4.10
def error(self, reason=None, type="parse"):
- raise Fail("%s error%s | Plugin out of date" % (type.capitalize(), ':' + str(reason) if reason else ""))
+ raise Fail("%s error%s | Plugin out of date" % (type.capitalize(), ': ' + str(reason) if reason else ""))
if self.core.debug:
print_exc()
diff --git a/module/plugins/internal/XFSPHoster.py b/module/plugins/internal/XFSPHoster.py
index 5d75e41a7..91a69116c 100644
--- a/module/plugins/internal/XFSPHoster.py
+++ b/module/plugins/internal/XFSPHoster.py
@@ -46,7 +46,7 @@ class XFSPHoster(SimpleHoster):
OVR_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
LINK_PATTERN = None #: final download url pattern
- CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)'
+ CAPTCHA_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)'
CAPTCHA_DIV_PATTERN = r'>Enter code.*?<div.*?>(.+?)</div>'
RECAPTCHA_PATTERN = None
SOLVEMEDIA_PATTERN = None
@@ -306,7 +306,7 @@ class XFSPHoster(SimpleHoster):
def handleCaptcha(self, inputs):
- m = re.search(self.CAPTCHA_URL_PATTERN, self.html)
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
if m:
captcha_url = m.group(1)
inputs['code'] = self.decryptCaptcha(captcha_url)