summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-06 14:28:32 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-06 14:28:32 +0200
commit82facc20b829d182bd0ae5787d29ed21f0f93fbc (patch)
tree14134e2b3c38fc927802c285acc1cb9b19b02728 /module
parent[CaptchaService] Restore req.load (diff)
downloadpyload-82facc20b829d182bd0ae5787d29ed21f0f93fbc.tar.xz
[SimpleHoster] Better filename processing + info about new pattern attributes
Diffstat (limited to 'module')
-rw-r--r--module/plugins/internal/SimpleHoster.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 160125cdf..6ad8398bb 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -106,7 +106,7 @@ def parseFileInfo(self, url='', html=''):
# File online, return name and size
info['status'] = 2
if 'N' in info:
- info['name'] = replace_patterns(info['N'], self.FILE_NAME_REPLACEMENTS)
+ info['name'] = replace_patterns(info['N'].strip(), self.FILE_NAME_REPLACEMENTS)
if 'S' in info:
size = replace_patterns(info['S'] + info['U'] if 'U' in info else info['S'],
self.FILE_SIZE_REPLACEMENTS)
@@ -153,7 +153,7 @@ class PluginParseError(Exception):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "0.37"
+ __version__ = "0.38"
__pattern__ = None
@@ -180,6 +180,12 @@ class SimpleHoster(Hoster):
PREMIUM_ONLY_PATTERN: (optional) Checks if the file can be downloaded only with a premium account
example: PREMIUM_ONLY_PATTERN = r'Premium account required'
+
+
+ Instead overriding handleFree and handlePremium methods now you can define patterns for direct download:
+
+ LINK_FREE_PATTERN: (optional) Get direct link for free download
+ LINK_PREMIUM_PATTERN: (optional) Get direct link for premium download
"""
FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup)]