diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-01 16:45:36 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-01 16:45:36 +0200 |
commit | 9ff63382d144732acb92cbe72ce7e58f5ac311a5 (patch) | |
tree | 929683b335743bb659c8f6afd84fdf8822f9ab7d /pyload/plugin/captcha/ReCaptcha.py | |
parent | Merge branch 'stable' into 0.4.10 (diff) | |
download | pyload-9ff63382d144732acb92cbe72ce7e58f5ac311a5.tar.xz |
Use 'import' instead 'from' (1)
Diffstat (limited to 'pyload/plugin/captcha/ReCaptcha.py')
-rw-r--r-- | pyload/plugin/captcha/ReCaptcha.py | 10 |
1 files changed, 5 insertions, 5 deletions
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, |