From 94966b3c2a093a79858dd9672ae2380bdc3ccf6e Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Tue, 13 Nov 2012 21:57:57 +0100 Subject: youtube config options, resume - closed #717, ul.to - closed #716, netload.in - fix some urls, linkdecrypter - fix crypter list --- module/plugins/hooks/LinkdecrypterCom.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks/LinkdecrypterCom.py') diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index ac939afd9..a554e05eb 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -24,28 +24,33 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" - __version__ = "0.14" + __version__ = "0.15" __description__ = """linkdecrypter.com - regexp loader""" __config__ = [ ("activated", "bool", "Activated" , "True") ] __author_name__ = ("zoidberg") - + def coreReady(self): page = getURL("http://linkdecrypter.com/") m = re.search(r'Supported: ([^+<]*)', page) if not m: self.logError(_("Crypter list not found")) return - - online = m.group(1).split(', ') + builtin = [ name.lower() for name in self.core.pluginManager.crypterPlugins.keys() ] builtin.extend([ "downloadserienjunkiesorg" ]) - - online = [ crypter.replace(".", "\\.") for crypter in online if remove_chars(crypter, "-.") not in builtin ] + + 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) + regexp = r"http://([^.]+\.)*?(%s)/.*" % "|".join(online) dict = self.core.pluginManager.crypterPlugins[self.__name__] dict["pattern"] = regexp -- cgit v1.2.3