summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/CaptchaService.py
diff options
context:
space:
mode:
authorGravatar zapp-brannigan <zapp-brannigan@users.noreply.github.com> 2015-01-30 16:37:47 +0100
committerGravatar zapp-brannigan <zapp-brannigan@users.noreply.github.com> 2015-01-30 16:37:47 +0100
commit5061a5e1034ee8a26203036fca00e264a62d6905 (patch)
tree974bc30c5456c5bca770f5cfea705e067b8d8a55 /module/plugins/internal/CaptchaService.py
parent[ExtractArchive] Fix https://github.com/pyload/pyload/issues/1100 (diff)
downloadpyload-5061a5e1034ee8a26203036fca00e264a62d6905.tar.xz
[CaptchaService.py] Fix ReCaptchaV2
Some small changes to make ReCaptchaV2 work again.
Diffstat (limited to 'module/plugins/internal/CaptchaService.py')
-rw-r--r--module/plugins/internal/CaptchaService.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py
index c6e83fe7d..c7dab2a0a 100644
--- a/module/plugins/internal/CaptchaService.py
+++ b/module/plugins/internal/CaptchaService.py
@@ -12,7 +12,7 @@ from module.common.json_layer import json_loads
class CaptchaService:
__name__ = "CaptchaService"
- __version__ = "0.20"
+ __version__ = "0.21"
__description__ = """Base captcha service plugin"""
__license__ = "GPLv3"
@@ -40,7 +40,7 @@ class CaptchaService:
class ReCaptcha(CaptchaService):
__name__ = "ReCaptcha"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """ReCaptcha captcha service plugin"""
__license__ = "GPLv3"
@@ -190,32 +190,34 @@ class ReCaptcha(CaptchaService):
token1 = re.search(r'id="recaptcha-token" value="(.*?)">', html)
self.plugin.logDebug("ReCaptcha token #1: %s" % token1.group(1))
-
+
html = self.plugin.req.load("https://www.google.com/recaptcha/api2/frame",
get={'c' : token1.group(1),
'hl' : language,
'v' : vers,
'bg' : botguardstring,
+ 'k' : key,
'usegapi': "1",
'jsh' : jsh}).decode('unicode-escape')
token2 = re.search(r'"finput","(.*?)",', html)
self.plugin.logDebug("ReCaptcha token #2: %s" % token2.group(1))
- token3 = re.search(r'."asconf".\s.\s,"(.*?)".', html)
+ token3 = re.search(r'."asconf".\s,".*?".\s,"(.*?)".', html)
self.plugin.logDebug("ReCaptcha token #3: %s" % token3.group(1))
html = self.plugin.req.load("https://www.google.com/recaptcha/api2/reload",
- post={'c' : token2.group(1),
+ post={'k' : key,
+ 'c' : token2.group(1),
'reason': "fi",
'fbg' : token3.group(1)})
token4 = re.search(r'"rresp","(.*?)",', html)
self.plugin.logDebug("ReCaptcha 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)}, forceUser=True)
+ get={'c':token4.group(1), 'k':key}, forceUser=True)
response = b64encode('{"response":"%s"}' % captcha_response)
self.plugin.logDebug("ReCaptcha result: %s" % response)
@@ -224,7 +226,8 @@ class ReCaptcha(CaptchaService):
timeToSolveMore = timeToSolve + int(float("0." + str(randint(1, 99999999))) * 500)
html = self.plugin.req.load("https://www.google.com/recaptcha/api2/userverify",
- post={'c' : token4.group(1),
+ post={'k' : key,
+ 'c' : token4.group(1),
'response': response,
't' : timeToSolve,
'ct' : timeToSolveMore,