diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-20 01:23:33 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-20 01:23:33 +0100 |
commit | 8f45ccee3c26f991738288805963a5961cd68267 (patch) | |
tree | 254739596a454861577ae3250a0f2fa87c3a2537 /module | |
parent | Fix plugin filename case (diff) | |
download | pyload-8f45ccee3c26f991738288805963a5961cd68267.tar.xz |
[SimpleHoster] Improve downloadLink routine
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/DeadCrypter.py | 3 | ||||
-rw-r--r-- | module/plugins/internal/DeadHoster.py | 3 | ||||
-rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/internal/DeadCrypter.py b/module/plugins/internal/DeadCrypter.py index 0fa23eef3..866d177cf 100644 --- a/module/plugins/internal/DeadCrypter.py +++ b/module/plugins/internal/DeadCrypter.py @@ -1,8 +1,5 @@ # -*- coding: utf-8 -*- -from urllib import unquote -from urlparse import urlparse - from module.plugins.internal.SimpleCrypter import create_getInfo from module.plugins.Crypter import Crypter as _Crypter diff --git a/module/plugins/internal/DeadHoster.py b/module/plugins/internal/DeadHoster.py index cc7adf4df..a6ad92607 100644 --- a/module/plugins/internal/DeadHoster.py +++ b/module/plugins/internal/DeadHoster.py @@ -1,8 +1,5 @@ # -*- coding: utf-8 -*- -from urllib import unquote -from urlparse import urlparse - from module.plugins.internal.SimpleHoster import create_getInfo from module.plugins.Hoster import Hoster as _Hoster diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 2e2f2ca0d..80504bf67 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -151,10 +151,10 @@ class SimpleCrypter(Crypter, SimpleHoster): Returns the links extracted from self.html You should override this only if it's impossible to extract links using only the LINK_PATTERN. """ - parsed = urlparse(self.pyfile.url) - base = "%s://%s" % (parsed.scheme, parsed.netloc) + url_p = urlparse(self.pyfile.url) + baseurl = "%s://%s" % (url_p.scheme, url_p.netloc) - return [urljoin(base, link) if not urlparse(link).scheme else link \ + return [urljoin(baseurl, link) if not urlparse(link).scheme else link \ for link in re.findall(self.LINK_PATTERN, self.html)] diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index d55ed6f99..78f5e531d 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -219,7 +219,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.04" + __version__ = "1.05" __pattern__ = r'^unmatchable$' @@ -467,6 +467,12 @@ class SimpleHoster(Hoster): def downloadLink(self, link): if link and isinstance(link, basestring): self.correctCaptcha() + + if not urlparse(link).scheme: + url_p = urlparse(self.pyfile.url) + baseurl = "%s://%s" % (url_p.scheme, url_p.netloc) + link = urljoin(baseurl, link) + self.download(link, disposition=False) #@TODO: Set `disposition=True` in 0.4.10 |