summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/captcha
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-13 10:21:32 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-13 10:21:32 +0200
commiteca20b701c411046e7ededb0462b310124ce3c18 (patch)
treec5eb36261cfc935f001b816f28f15d1f5afbf7e0 /pyload/plugin/captcha
parentMerge branch 'stable' into 0.4.10 (diff)
downloadpyload-eca20b701c411046e7ededb0462b310124ce3c18.tar.xz
Cleanup + fixup + new lib
Diffstat (limited to 'pyload/plugin/captcha')
-rw-r--r--pyload/plugin/captcha/AdsCaptcha.py4
-rw-r--r--pyload/plugin/captcha/ReCaptcha.py23
-rw-r--r--pyload/plugin/captcha/SolveMedia.py2
3 files changed, 10 insertions, 19 deletions
diff --git a/pyload/plugin/captcha/AdsCaptcha.py b/pyload/plugin/captcha/AdsCaptcha.py
index 5b23247c0..89579881f 100644
--- a/pyload/plugin/captcha/AdsCaptcha.py
+++ b/pyload/plugin/captcha/AdsCaptcha.py
@@ -17,8 +17,8 @@ class AdsCaptcha(Captcha):
__authors__ = [("pyLoad Team", "admin@pyload.org")]
- CAPTCHAID_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?[^"\']*CaptchaId=(\d+)'
- PUBLICKEY_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?[^"\']*PublicKey=([\w-]+)'
+ CAPTCHAID_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?.*?CaptchaId=(\d+)'
+ PUBLICKEY_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?.*?PublicKey=([\w-]+)'
def detect_key(self, html=None):
diff --git a/pyload/plugin/captcha/ReCaptcha.py b/pyload/plugin/captcha/ReCaptcha.py
index 6dcb09f55..4920262b2 100644
--- a/pyload/plugin/captcha/ReCaptcha.py
+++ b/pyload/plugin/captcha/ReCaptcha.py
@@ -13,7 +13,7 @@ from pyload.plugin.Captcha import Captcha
class ReCaptcha(Captcha):
__name__ = "ReCaptcha"
__type__ = "captcha"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """ReCaptcha captcha service plugin"""
__license__ = "GPLv3"
@@ -161,21 +161,12 @@ class ReCaptcha(Captcha):
token2 = re.search(r'"finput","(.*?)",', html)
self.logDebug("Token #2: %s" % token2.group(1))
- token3 = re.search(r'."asconf".\s,".*?".\s,"(.*?)".', html)
+ token3 = re.search(r'"rresp","(.*?)",', html)
self.logDebug("Token #3: %s" % token3.group(1))
- html = self.plugin.req.load("https://www.google.com/recaptcha/api2/reload",
- post={'k' : key,
- 'c' : token2.group(1),
- 'reason': "fi",
- 'fbg' : token3.group(1)})
-
- token4 = re.search(r'"rresp","(.*?)",', html)
- self.logDebug("Token #4: %s" % token4.group(1))
-
millis_captcha_loading = int(round(time.time() * 1000))
captcha_response = self.plugin.decryptCaptcha("https://www.google.com/recaptcha/api2/payload",
- get={'c': token4.group(1), 'k': key},
+ get={'c':token3.group(1), 'k':key},
cookies=True,
forceUser=True)
response = b64encode('{"response":"%s"}' % captcha_response)
@@ -187,15 +178,15 @@ class ReCaptcha(Captcha):
html = self.plugin.req.load("https://www.google.com/recaptcha/api2/userverify",
post={'k' : key,
- 'c' : token4.group(1),
+ 'c' : token3.group(1),
'response': response,
't' : timeToSolve,
'ct' : timeToSolveMore,
'bg' : botguardstring})
- token5 = re.search(r'"uvresp","(.*?)",', html)
- self.logDebug("Token #5: %s" % token5.group(1))
+ token4 = re.search(r'"uvresp","(.*?)",', html)
+ self.logDebug("Token #4: %s" % token4.group(1))
- result = token5.group(1)
+ result = token4.group(1)
return result, None
diff --git a/pyload/plugin/captcha/SolveMedia.py b/pyload/plugin/captcha/SolveMedia.py
index 7f421f490..45f7a69e8 100644
--- a/pyload/plugin/captcha/SolveMedia.py
+++ b/pyload/plugin/captcha/SolveMedia.py
@@ -49,7 +49,7 @@ class SolveMedia(Captcha):
html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.noscript",
get={'k': key})
try:
- challenge = re.search(r'<input type=hidden name="adcopy_challenge" id="adcopy_challenge" value="([^"]+)">',
+ challenge = re.search(r'<input type=hidden name="adcopy_challenge" id="adcopy_challenge" value="(.+?)">',
html).group(1)
server = "http://api.solvemedia.com/papi/media"