diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-25 14:13:18 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-25 14:13:18 +0200 |
commit | 3be549693a8aaac758f0f1690eefe409e45c003f (patch) | |
tree | 26d733972cf89fd87e69dd97741b0276a31b8499 /module/plugins | |
parent | [UserAgentSwitcher] Fixup (2) (diff) | |
download | pyload-3be549693a8aaac758f0f1690eefe409e45c003f.tar.xz |
Some urljoin fixes
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/crypter/FourChanOrg.py | 3 | ||||
-rw-r--r-- | module/plugins/crypter/LixIn.py | 3 | ||||
-rw-r--r-- | module/plugins/hoster/CrockoCom.py | 5 | ||||
-rw-r--r-- | module/plugins/hoster/NarodRu.py | 3 | ||||
-rw-r--r-- | module/plugins/hoster/UloziskoSk.py | 3 | ||||
-rw-r--r-- | module/plugins/hoster/YibaishiwuCom.py | 3 |
6 files changed, 13 insertions, 7 deletions
diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index c90c84b6f..366adef14 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -3,6 +3,7 @@ # Based on 4chandl by Roland Beermann (https://gist.github.com/enkore/3492599) import re +import urlparse from module.plugins.Crypter import Crypter @@ -24,4 +25,4 @@ class FourChanOrg(Crypter): def decrypt(self, pyfile): pagehtml = self.load(pyfile.url) images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]+)', pagehtml)) - self.urls = ["http://" + image for image in images] + self.urls = [urlparse.urljoin("http://", image) for image in images] diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 66a0cf339..5c77eae5e 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re +import urlparse from module.plugins.Crypter import Crypter @@ -46,7 +47,7 @@ class LixIn(Crypter): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: self.logDebug("Trying captcha") - captcharesult = self.decryptCaptcha("http://lix.in/" + m.group(1)) + captcharesult = self.decryptCaptcha(urlparse.urljoin("http://lix.in/", m.group(1))) self.html = self.load(url, decode=True, post={"capt": captcharesult, "submit": "submit", "tiny": id}) else: diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 1d7468520..4f872f60a 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re +import urlparse from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -38,8 +39,8 @@ class CrockoCom(SimpleHoster): for _i in xrange(5): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: - url, wait_time = 'http://crocko.com' + m.group(1), int(m.group(2)) - self.wait(wait_time) + url = urlparse.urljoin("http://crocko.com", m.group(1)) + self.wait(m.group(2)) self.html = self.load(url) else: break diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index b7380add0..c201ac250 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -2,6 +2,7 @@ import random import re +import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -47,7 +48,7 @@ class NarodRu(SimpleHoster): m = re.search(self.LINK_FREE_PATTERN, self.html) if m: - self.link = 'http://narod.ru' + m.group(1) + self.link = urlparse.urljoin("http://narod.ru", m.group(1)) self.correctCaptcha() break diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index d687ae7cb..ad809b47c 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re +import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -55,8 +56,8 @@ class UloziskoSk(SimpleHoster): m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: self.error(_("CAPTCHA_PATTERN not found")) - captcha_url = 'http://www.ulozisko.sk' + m.group(1) + captcha_url = urlparse.urljoin("http://www.ulozisko.sk", m.group(1)) captcha = self.decryptCaptcha(captcha_url, cookies=True) self.logDebug("CAPTCHA_URL:" + captcha_url + ' CAPTCHA:' + captcha) diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index 7ca6e1ac0..00185c05a 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re +import urlparse from module.common.json_layer import json_loads from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -35,7 +36,7 @@ class YibaishiwuCom(SimpleHoster): self.logDebug(('FREEUSER' if m.group(2) == 'download' else 'GUEST') + ' URL', url) - res = json_loads(self.load("http://115.com" + url, decode=False)) + res = json_loads(self.load(urlparse.urljoin("http://115.com", url), decode=False)) if "urls" in res: mirrors = res['urls'] |