From c0a7430ef5218da41787de001de04d3ded89d8b5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 21:21:47 +0100 Subject: [LinkdecrypterCom] Extend MultiHook --- module/plugins/hooks/LinkdecrypterCom.py | 64 +++++++------------------------- 1 file changed, 13 insertions(+), 51 deletions(-) (limited to 'module/plugins/hooks/LinkdecrypterCom.py') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index b0ce335d0..8592efd3d 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -2,64 +2,26 @@ import re -from module.network.RequestFactory import getURL -from module.plugins.Hook import Hook -from module.utils import remove_chars +from module.plugins.internal.MultiHook import MultiHook -class LinkdecrypterCom(Hook): +class LinkdecrypterCom(MultiHook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "0.21" + __version__ = "1.00" + + __config__ = [("mode" , "all;listed;unlisted", "Use for crypters (if supported)" , "all"), + ("pluginlist" , "str" , "Crypter list (comma separated)" , "" ), + ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] __description__ = """Linkdecrypter.com hook plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - #@TODO: Remove in 0.4.10 - def initPeriodical(self): - pass - - def coreReady(self): + def getCrypters(self): try: - self.loadPatterns() - except Exception, e: - self.logError(e) - - - def loadPatterns(self): - html = getURL("http://linkdecrypter.com/") - - m = re.search(r'', 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) - - dict = self.core.pluginManager.crypterPlugins[self.__name__] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) - - self.logDebug("Loaded pattern: %s" % regexp) + html = self.getURL("http://linkdecrypter.com/") + return re.search(r'>Supported\(\d+\)</b>: <i>(.+?) \+ RSDF', html).group(1).split(', ') + except Exception: + return list() -- cgit v1.2.3 From e977be3c78ea9d976e9b2338244b214a4b3a5199 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Thu, 8 Jan 2015 23:40:17 +0100 Subject: "New Year" Update: hook plugins --- module/plugins/hooks/LinkdecrypterCom.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/LinkdecrypterCom.py') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 8592efd3d..d4924a687 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -8,11 +8,12 @@ from module.plugins.internal.MultiHook import MultiHook class LinkdecrypterCom(MultiHook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "1.00" + __version__ = "1.01" - __config__ = [("mode" , "all;listed;unlisted", "Use for crypters (if supported)" , "all"), - ("pluginlist" , "str" , "Crypter list (comma separated)" , "" ), - ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] + __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" -- cgit v1.2.3 From b205352a18db19f9fccb2f8dd73a12e6e87ef58d Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 16 Jan 2015 01:37:19 +0100 Subject: [LinkdecrypterCom] Improve getCrypters routine --- module/plugins/hooks/LinkdecrypterCom.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks/LinkdecrypterCom.py') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index d4924a687..f85a598bc 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class LinkdecrypterCom(MultiHook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "1.01" + __version__ = "1.02" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), @@ -21,8 +21,5 @@ class LinkdecrypterCom(MultiHook): def getCrypters(self): - try: - html = self.getURL("http://linkdecrypter.com/") - return re.search(r'>Supported\(\d+\)</b>: <i>(.+?) \+ RSDF', html).group(1).split(', ') - except Exception: - return list() + return re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)', + self.getURL("http://linkdecrypter.com/").replace("(g)", "")).group(1).split(', ') -- cgit v1.2.3 From f85e28e565a1e0a76e6271d0b0853d6d48b4a043 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@users.noreply.github.com> Date: Tue, 10 Mar 2015 01:16:29 +0100 Subject: [MultiHook] Fix _pluginSet (fix LinkdecrypterCom issue) --- module/plugins/hooks/LinkdecrypterCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/LinkdecrypterCom.py') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index f85a598bc..769e63e81 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class LinkdecrypterCom(MultiHook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "1.02" + __version__ = "1.03" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), @@ -22,4 +22,4 @@ class LinkdecrypterCom(MultiHook): def getCrypters(self): return re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)', - self.getURL("http://linkdecrypter.com/").replace("(g)", "")).group(1).split(', ') + self.getURL("http://linkdecrypter.com/", decode=True).replace("(g)", "")).group(1).split(', ') -- cgit v1.2.3 From 348a386486d081d86363774e64525484ef159cd6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@users.noreply.github.com> Date: Wed, 8 Apr 2015 19:23:06 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1157 --- module/plugins/hooks/LinkdecrypterCom.py | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 module/plugins/hooks/LinkdecrypterCom.py (limited to 'module/plugins/hooks/LinkdecrypterCom.py') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py deleted file mode 100644 index 769e63e81..000000000 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from module.plugins.internal.MultiHook import MultiHook - - -class LinkdecrypterCom(MultiHook): - __name__ = "LinkdecrypterCom" - __type__ = "hook" - __version__ = "1.03" - - __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__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - def getCrypters(self): - return re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)', - self.getURL("http://linkdecrypter.com/", decode=True).replace("(g)", "")).group(1).split(', ') -- cgit v1.2.3