diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-08 12:55:45 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-08 12:55:45 +0100 |
commit | 0bbc20062b99a9bd627ca5cce2f43188838611f0 (patch) | |
tree | a013e86bec48b6523450b58b5887ccdc77a69ea7 | |
parent | [OneFichierCom] Temp bugfix (diff) | |
download | pyload-0bbc20062b99a9bd627ca5cce2f43188838611f0.tar.xz |
[LinkdecrypterCom] Check if is down
-rw-r--r-- | module/plugins/hooks/LinkdecrypterCom.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 9343208de..6194f67f1 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -10,7 +10,7 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __description__ = """Linkdecrypter.com hook plugin""" __license__ = "GPLv3" @@ -21,12 +21,18 @@ class LinkdecrypterCom(Hook): try: self.loadPatterns() except Exception, e: - self.logError(e) + self.logError(str(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 @@ -51,4 +57,4 @@ class LinkdecrypterCom(Hook): dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("REGEXP", regexp) + self.logDebug("Loaded pattern: %s" % regexp) |