summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hook/LinkdecrypterCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/hook/LinkdecrypterCom.py')
-rw-r--r--pyload/plugins/hook/LinkdecrypterCom.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/pyload/plugins/hook/LinkdecrypterCom.py b/pyload/plugins/hook/LinkdecrypterCom.py
index ea1e54b30..8455ed904 100644
--- a/pyload/plugins/hook/LinkdecrypterCom.py
+++ b/pyload/plugins/hook/LinkdecrypterCom.py
@@ -8,14 +8,13 @@ from pyload.utils import remove_chars
class LinkdecrypterCom(Hook):
- __name__ = "LinkdecrypterCom"
- __type__ = "hook"
- __version__ = "0.19"
-
- __config__ = [("activated", "bool", "Activated", False)]
+ __name__ = "LinkdecrypterCom"
+ __type__ = "hook"
+ __version__ = "0.20"
__description__ = """Linkdecrypter.com hook plugin"""
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
+ __license__ = "GPLv3"
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
def coreReady(self):
@@ -24,9 +23,16 @@ class LinkdecrypterCom(Hook):
except Exception, e:
self.logError(e)
+
def loadPatterns(self):
- page = getURL("http://linkdecrypter.com/")
- m = re.search(r'<b>Supported\(\d+\)</b>: <i>([^+<]*)', page)
+ 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
@@ -45,10 +51,10 @@ class LinkdecrypterCom(Hook):
self.logError(_("Crypter list is empty"))
return
- regexp = r"https?://([^.]+\.)*?(%s)/.*" % "|".join(online)
+ regexp = r'https?://([^.]+\.)*?(%s)/.*' % '|'.join(online)
dict = self.core.pluginManager.crypterPlugins[self.__name__]
dict['pattern'] = regexp
dict['re'] = re.compile(regexp)
- self.logDebug("REGEXP", regexp)
+ self.logDebug("Loaded pattern: %s" % regexp)