summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/internal/CaptchaService.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-28 21:19:03 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-28 21:19:03 +0200
commit46c6fc74a4e423927554f024b78dbbbf33e982cd (patch)
treee7ff9580bb5e80b91e2bd9609409116a19c5941e /pyload/plugins/internal/CaptchaService.py
parentApi : Add brackets and pipe to urlmatcher (diff)
parent[XFileSharingPro] Fixed typo (diff)
downloadpyload-46c6fc74a4e423927554f024b78dbbbf33e982cd.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: pyload/plugins/crypter/MultiuploadCom.py pyload/plugins/crypter/SerienjunkiesOrg.py pyload/plugins/hooks/ExternalScripts.py pyload/plugins/hooks/ExtractArchive.py pyload/plugins/hooks/MergeFiles.py pyload/plugins/hoster/CatShareNet.py pyload/plugins/hoster/FilezyNet.py pyload/plugins/hoster/IFileWs.py pyload/plugins/hoster/PremiumTo.py pyload/plugins/hoster/SpeedyshareCom.py pyload/plugins/hoster/UptoboxCom.py pyload/plugins/hoster/XFileSharingPro.py pyload/plugins/hoster/ZippyshareCom.py
Diffstat (limited to 'pyload/plugins/internal/CaptchaService.py')
-rw-r--r--pyload/plugins/internal/CaptchaService.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/pyload/plugins/internal/CaptchaService.py b/pyload/plugins/internal/CaptchaService.py
index b247ba654..26482379d 100644
--- a/pyload/plugins/internal/CaptchaService.py
+++ b/pyload/plugins/internal/CaptchaService.py
@@ -7,7 +7,7 @@ from random import random
class CaptchaService:
__name__ = "CaptchaService"
- __version__ = "0.05"
+ __version__ = "0.06"
__description__ = """Captcha service plugin"""
__author_name__ = "pyLoad Team"
@@ -28,6 +28,7 @@ class ReCaptcha:
def __init__(self, plugin):
self.plugin = plugin
+
def detect_key(self, html):
m = re.search(self.RECAPTCHA_KEY_PATTERN, html)
if m is None:
@@ -38,11 +39,13 @@ class ReCaptcha:
else:
return None
+
def challenge(self, key=None):
- if key is None and self.recaptcha_key:
- key = self.recaptcha_key
- else:
- raise TypeError("ReCaptcha key not found")
+ if not key:
+ if self.recaptcha_key:
+ key = self.recaptcha_key
+ else:
+ raise TypeError("ReCaptcha key not found")
js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={"k": key}, cookies=True)
@@ -55,6 +58,7 @@ class ReCaptcha:
return challenge, result
+
def result(self, server, challenge):
return self.plugin.decryptCaptcha("%simage" % server, get={"c": challenge},
cookies=True, forceUser=True, imgtype="jpg")
@@ -74,6 +78,7 @@ class AdsCaptcha(CaptchaService):
return challenge, result
+
def result(self, server, challenge):
return self.plugin.decryptCaptcha("%sChallenge.aspx" % server, get={"cid": challenge, "dummy": random()},
cookies=True, imgtype="jpg")
@@ -92,5 +97,6 @@ class SolveMedia(CaptchaService):
return challenge, result
+
def result(self, challenge):
return self.plugin.decryptCaptcha("http://api.solvemedia.com/papi/media?c=%s" % challenge, imgtype="gif")