summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/LinkdecrypterCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/LinkdecrypterCom.py')
-rw-r--r--module/plugins/hooks/LinkdecrypterCom.py59
1 files changed, 12 insertions, 47 deletions
diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py
index fff596386..f85a598bc 100644
--- a/module/plugins/hooks/LinkdecrypterCom.py
+++ b/module/plugins/hooks/LinkdecrypterCom.py
@@ -2,59 +2,24 @@
import re
-from pyload.network.RequestFactory import getURL
-from pyload.plugin.Addon import Addon
-from pyload.utils import remove_chars
+from module.plugins.internal.MultiHook import MultiHook
-class LinkdecrypterCom(Addon):
+class LinkdecrypterCom(MultiHook):
__name__ = "LinkdecrypterCom"
__type__ = "hook"
- __version__ = "0.21"
+ __version__ = "1.02"
+
+ __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 )]
__description__ = """Linkdecrypter.com hook plugin"""
__license__ = "GPLv3"
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
-
-
- def activate(self):
- try:
- self.loadPatterns()
- except Exception, e:
- self.logError(e)
-
-
- def loadPatterns(self):
- html = getURL("http://linkdecrypter.com/")
-
- m = re.search(r'<title>', html)
- if m is None:
- self.logError(_("Linkdecrypter site is down"))
- return
-
- m = re.search(r'<b>Supported\(\d+\)</b>: <i>([^+<]*)', html)
- if m is None:
- self.logError(_("Crypter list not found"))
- return
-
- builtin = [name.lower() for name in self.core.pluginManager.crypterPlugins.keys()]
- builtin.append("downloadserienjunkiesorg")
-
- crypter_pattern = re.compile("(\w[\w.-]+)")
- online = []
- for crypter in m.group(1).split(', '):
- m = re.match(crypter_pattern, crypter)
- if m and remove_chars(m.group(1), "-.") not in builtin:
- online.append(m.group(1).replace(".", "\\."))
-
- if not online:
- self.logError(_("Crypter list is empty"))
- return
-
- regexp = r'https?://([^.]+\.)*?(%s)/.*' % '|'.join(online)
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- dict = self.core.pluginManager.crypterPlugins[self.__name__]
- dict['pattern'] = regexp
- dict['re'] = re.compile(regexp)
- self.logDebug("Loaded pattern: %s" % regexp)
+ def getCrypters(self):
+ return re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)',
+ self.getURL("http://linkdecrypter.com/").replace("(g)", "")).group(1).split(', ')