diff options
author | igel-kun <mathiaswe@gmx.de> | 2014-09-15 23:10:37 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-15 23:10:37 +0200 |
commit | df2dcf1ccdbcc5197a224df9946595df907dc749 (patch) | |
tree | 6702f023af2829ac7022e89bc039cb103966a693 /module/plugins/hooks/XFileSharingPro.py | |
parent | [BasePlugin] Little code cosmetics (diff) | |
download | pyload-df2dcf1ccdbcc5197a224df9946595df907dc749.tar.xz |
[XFilesharingPro] Embedded urls support
Diffstat (limited to 'module/plugins/hooks/XFileSharingPro.py')
-rw-r--r-- | module/plugins/hooks/XFileSharingPro.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index eb0376921..e19b40e22 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", True), ("loadDefault", "bool", "Include default (built-in) hoster list", True), @@ -23,6 +23,7 @@ class XFileSharingPro(Hook): def coreReady(self): self.loadPattern() + def loadPattern(self): hosterList = self.getConfigSet('includeList') excludeList = self.getConfigSet('excludeList') @@ -60,7 +61,7 @@ class XFileSharingPro(Hook): self.unload() return - regexp = r"http://(?:[^/]*\.)?(%s)/\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) + regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] @@ -68,10 +69,12 @@ class XFileSharingPro(Hook): dict['re'] = re.compile(regexp) self.logDebug("Pattern loaded - handling %d hosters" % len(hosterList)) + def getConfigSet(self, option): s = self.getConfig(option).lower().replace('|', ',').replace(';', ',') return set([x.strip() for x in s.split(',')]) + def unload(self): dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = r'^unmatchable$' |