summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/SimpleCrypter.py
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/plugins/internal/SimpleCrypter.py
parent[SimplyPremiumCom] Improve account (diff)
downloadpyload-6343210720782fa99f679f87447c1418ee5875cb.tar.xz
[SimpleCrypter] getLinks auto-complete links
Diffstat (limited to 'module/plugins/internal/SimpleCrypter.py')
-rw-r--r--module/plugins/internal/SimpleCrypter.py10
1 files changed, 7 insertions, 3 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):