diff options
Diffstat (limited to 'pyload/plugin/captcha')
-rw-r--r-- | pyload/plugin/captcha/AdsCaptcha.py | 5 | ||||
-rw-r--r-- | pyload/plugin/captcha/ReCaptcha.py | 10 |
2 files changed, 7 insertions, 8 deletions
diff --git a/pyload/plugin/captcha/AdsCaptcha.py b/pyload/plugin/captcha/AdsCaptcha.py index a0ccdda58..c2caa7bf6 100644 --- a/pyload/plugin/captcha/AdsCaptcha.py +++ b/pyload/plugin/captcha/AdsCaptcha.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- +import random import re -from random import random - from pyload.plugin.Captcha import Captcha @@ -71,7 +70,7 @@ class AdsCaptcha(Captcha): def result(self, server, challenge): result = self.plugin.decryptCaptcha("%sChallenge.aspx" % server, - get={'cid': challenge, 'dummy': random()}, + get={'cid': challenge, 'dummy': random.random()}, cookies=True, imgtype="jpg") diff --git a/pyload/plugin/captcha/ReCaptcha.py b/pyload/plugin/captcha/ReCaptcha.py index 9c75c2212..dc431f2ea 100644 --- a/pyload/plugin/captcha/ReCaptcha.py +++ b/pyload/plugin/captcha/ReCaptcha.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- +import random import re import time +import urlparse from base64 import b64encode -from random import randint -from urlparse import urljoin, urlparse from pyload.plugin.Captcha import Captcha @@ -122,7 +122,7 @@ class ReCaptcha(Captcha): self.logDebug("Time: %s" % millis) - rand = randint(1, 99999999) + rand = random.randint(1, 99999999) a = "0.%s" % str(rand * 2147483647) rpc = int(100000000 * float(a)) @@ -134,7 +134,7 @@ class ReCaptcha(Captcha): def _challenge_v2(self, key, parent=None): if parent is None: try: - parent = urljoin("http://", urlparse(self.plugin.pyfile.url).netloc) + parent = urlparse.urljoin("http://", urlparse.urlparse(self.plugin.pyfile.url).netloc) except Exception: parent = "" @@ -181,7 +181,7 @@ class ReCaptcha(Captcha): self.logDebug("Result: %s" % response) timeToSolve = int(round(time.time() * 1000)) - millis_captcha_loading - timeToSolveMore = timeToSolve + int(float("0." + str(randint(1, 99999999))) * 500) + timeToSolveMore = timeToSolve + int(float("0." + str(random.randint(1, 99999999))) * 500) html = self.plugin.req.load("https://www.google.com/recaptcha/api2/userverify", post={'k' : key, |