summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-18 16:46:41 +0200
committerGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-18 16:46:41 +0200
commitf44e1d49cbde4596befeac81b240712746a91020 (patch)
treee7c9d5b459086c221e771ac3170974666f0345de
parentfix: color_logger (diff)
downloadpyload-f44e1d49cbde4596befeac81b240712746a91020.tar.xz
fixed: MultiHook
-rw-r--r--pyload/manager/Plugin.py8
-rw-r--r--pyload/plugin/internal/MultiHook.py64
2 files changed, 37 insertions, 35 deletions
diff --git a/pyload/manager/Plugin.py b/pyload/manager/Plugin.py
index 905ce524e..a081a643e 100644
--- a/pyload/manager/Plugin.py
+++ b/pyload/manager/Plugin.py
@@ -224,10 +224,12 @@ class PluginManager(object):
def findPlugin(self, type, name):
- if type not in self.plugins:
- return None
+ if isinstance(type, tuple):
+ for typ in type:
+ if name in self.plugins[typ]:
+ return (self.plugins[typ][name], typ)
- elif name not in self.plugins[type]:
+ if isinstance(type, tuple) or type not in self.plugins or name not in self.plugins[type]:
self.core.log.warning(_("Plugin [%(type)s] %(name)s not found | Using plugin: [internal] BasePlugin")
% {'name': name, 'type': type})
return self.internalPlugins['BasePlugin']
diff --git a/pyload/plugin/internal/MultiHook.py b/pyload/plugin/internal/MultiHook.py
index 87b01c13a..f48ae0909 100644
--- a/pyload/plugin/internal/MultiHook.py
+++ b/pyload/plugin/internal/MultiHook.py
@@ -14,44 +14,44 @@ class MultiHook(Hook):
__version = "0.44"
__config = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"),
- ("pluginlist" , "str" , "Plugin list (comma separated)", "" ),
- ("reload" , "bool" , "Reload plugin list" , True ),
- ("reloadinterval", "int" , "Reload interval in hours" , 12 )]
+ ("pluginlist" , "str" , "Plugin list (comma separated)", ""),
+ ("reload" , "bool" , "Reload plugin list" , True),
+ ("reloadinterval", "int" , "Reload interval in hours" , 12)]
__description = """Hook plugin for multi hoster/crypter"""
__license = "GPLv3"
- __authors = [("pyLoad Team" , "admin@pyload.org" ),
- ("Walter Purcaro", "vuolter@gmail.com")]
+ __authors = [("pyLoad Team" , "admin@pyload.org"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
MIN_RELOAD_INTERVAL = 1 * 60 * 60 #: 1 hour
DOMAIN_REPLACEMENTS = [(r'180upload\.com' , "hundredeightyupload.com"),
- (r'bayfiles\.net' , "bayfiles.com" ),
- (r'cloudnator\.com' , "shragle.com" ),
- (r'dfiles\.eu' , "depositfiles.com" ),
- (r'easy-share\.com' , "crocko.com" ),
- (r'freakshare\.net' , "freakshare.com" ),
- (r'hellshare\.com' , "hellshare.cz" ),
- (r'ifile\.it' , "filecloud.io" ),
- (r'nowdownload\.\w+', "nowdownload.sx" ),
- (r'nowvideo\.\w+' , "nowvideo.sx" ),
- (r'putlocker\.com' , "firedrive.com" ),
- (r'share-?rapid\.cz', "multishare.cz" ),
- (r'ul\.to' , "uploaded.to" ),
- (r'uploaded\.net' , "uploaded.to" ),
- (r'uploadhero\.co' , "uploadhero.com" ),
- (r'zshares\.net' , "zshare.net" ),
- (r'^1' , "one" ),
- (r'^2' , "two" ),
- (r'^3' , "three" ),
- (r'^4' , "four" ),
- (r'^5' , "five" ),
- (r'^6' , "six" ),
- (r'^7' , "seven" ),
- (r'^8' , "eight" ),
- (r'^9' , "nine" ),
- (r'^0' , "zero" )]
+ (r'bayfiles\.net' , "bayfiles.com"),
+ (r'cloudnator\.com' , "shragle.com"),
+ (r'dfiles\.eu' , "depositfiles.com"),
+ (r'easy-share\.com' , "crocko.com"),
+ (r'freakshare\.net' , "freakshare.com"),
+ (r'hellshare\.com' , "hellshare.cz"),
+ (r'ifile\.it' , "filecloud.io"),
+ (r'nowdownload\.\w+', "nowdownload.sx"),
+ (r'nowvideo\.\w+' , "nowvideo.sx"),
+ (r'putlocker\.com' , "firedrive.com"),
+ (r'share-?rapid\.cz', "multishare.cz"),
+ (r'ul\.to' , "uploaded.to"),
+ (r'uploaded\.net' , "uploaded.to"),
+ (r'uploadhero\.co' , "uploadhero.com"),
+ (r'zshares\.net' , "zshare.net"),
+ (r'^1' , "one"),
+ (r'^2' , "two"),
+ (r'^3' , "three"),
+ (r'^4' , "four"),
+ (r'^5' , "five"),
+ (r'^6' , "six"),
+ (r'^7' , "seven"),
+ (r'^8' , "eight"),
+ (r'^9' , "nine"),
+ (r'^0' , "zero")]
def setup(self):
@@ -70,7 +70,7 @@ class MultiHook(Hook):
def initPlugin(self):
self.pluginname = self.__class__.__name__
- plugin, self.plugintype = self.core.pluginManager.findPlugin(self.pluginname)
+ plugin, self.plugintype = self.core.pluginManager.findPlugin(("hoster", "decrypter", "container"), self.pluginname)
if plugin:
self.pluginmodule = self.core.pluginManager.loadModule(self.plugintype, self.pluginname)
@@ -159,7 +159,7 @@ class MultiHook(Hook):
for r in self.DOMAIN_REPLACEMENTS:
rf, rt = r
- repr = re.compile(rf, re.I|re.U)
+ repr = re.compile(rf, re.I | re.U)
plugins = [re.sub(rf, rt, p) if repr.match(p) else p for p in plugins]
return set(plugins)