summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-13 01:43:29 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-13 01:43:29 +0100
commit6343210720782fa99f679f87447c1418ee5875cb (patch)
treecff96259f3df66bedbdac70caaf27a47c9cc7aef /module
parent[SimplyPremiumCom] Improve account (diff)
downloadpyload-6343210720782fa99f679f87447c1418ee5875cb.tar.xz
[SimpleCrypter] getLinks auto-complete links
Diffstat (limited to 'module')
-rw-r--r--module/plugins/internal/SimpleCrypter.py10
-rw-r--r--module/plugins/internal/SimpleHoster.py4
2 files changed, 9 insertions, 5 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index 43b1347fd..d33ad77e9 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -2,7 +2,7 @@
import re
-from urlparse import urlparse
+from urlparse import urljoin, urlparse
from module.plugins.Crypter import Crypter
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns, set_cookies
@@ -12,7 +12,7 @@ from module.utils import fixup
class SimpleCrypter(Crypter, SimpleHoster):
__name__ = "SimpleCrypter"
__type__ = "crypter"
- __version__ = "0.38"
+ __version__ = "0.39"
__pattern__ = r'^unmatchable$'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config['general']['folder_per_package']
@@ -151,7 +151,11 @@ 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.
"""
- return re.findall(self.LINK_PATTERN, self.html)
+ parsed = urlparse(self.pyfile.url)
+ base = "%s://%s" % (parsed.scheme, parsed.netloc)
+
+ return [urljoin(base, link) if not urlparse(link).scheme else link \
+ for link in re.finditer(self.LINK_PATTERN, self.html)]
def handlePages(self, pyfile):
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index fa1ea45f2..4c3d376ca 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -145,8 +145,8 @@ def directLink(self, url, resumable=False):
location = header['location']
if not urlparse(location).scheme:
- p = urlparse(url)
- base = "%s://%s" % (p.scheme, p.netloc)
+ parsed = urlparse(url)
+ base = "%s://%s" % (parsed.scheme, parsed.netloc)
location = urljoin(base, location)
if resumable: