diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-27 21:21:47 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-27 21:21:47 +0100 |
commit | c0a7430ef5218da41787de001de04d3ded89d8b5 (patch) | |
tree | 7a70a81e8d716c5113a7ace50e01e090ea892cfb /module/plugins/crypter | |
parent | Update MultiHook based hooks (diff) | |
download | pyload-c0a7430ef5218da41787de001de04d3ded89d8b5.tar.xz |
[LinkdecrypterCom] Extend MultiHook
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/LinkdecrypterCom.py | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 91318eadf..7eb5d3096 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -7,13 +7,13 @@ from module.plugins.Crypter import Crypter class LinkdecrypterCom(Crypter): __name__ = "LinkdecrypterCom" __type__ = "crypter" - __version__ = "0.27" + __version__ = "0.28" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] - __description__ = """Linkdecrypter.com""" + __description__ = """Linkdecrypter.com decrypter plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("flowlee", None)] @@ -21,13 +21,16 @@ class LinkdecrypterCom(Crypter): TEXTAREA_PATTERN = r'<textarea name="links" wrap="off" readonly="1" class="caja_des">(.+)</textarea>' PASSWORD_PATTERN = r'<input type="text" name="password"' - CAPTCHA_PATTERN = r'<img class="captcha" src="(.+?)"(.*?)>' - REDIR_PATTERN = r'<i>(Click <a href="./">here</a> if your browser does not redirect you).</i>' + CAPTCHA_PATTERN = r'<img class="captcha" src="(.+?)"(.*?)>' + REDIR_PATTERN = r'<i>(Click <a href="./">here</a> if your browser does not redirect you).</i>' - def decrypt(self, pyfile): - self.passwords = self.getPassword().splitlines() + def setup(self): + self.password = self.getPassword() + self.req.setOption("timeout", 300) + + def decrypt(self, pyfile): # API not working anymore self.urls = self.decryptHTML() @@ -39,10 +42,11 @@ class LinkdecrypterCom(Crypter): return self.html.splitlines() if self.html == 'INTERRUPTION(PASSWORD)': - for get_dict['pass'] in self.passwords: - self.html = self.load('http://linkdecrypter.com/api', get=get_dict) - if self.html.startswith('http://'): - return self.html.splitlines() + get_dict['pass'] = self.password + + self.html = self.load('http://linkdecrypter.com/api', get=get_dict) + if self.html.startswith('http://'): + return self.html.splitlines() self.logError("API", self.html) if self.html == 'INTERRUPTION(PASSWORD)': @@ -57,7 +61,7 @@ class LinkdecrypterCom(Crypter): post_dict = {"link_cache": "on", "pro_links": self.pyfile.url, "modo_links": "text"} self.html = self.load('http://linkdecrypter.com/', post=post_dict, cookies=True, decode=True) - while self.passwords or retries: + while retries: m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.S) if m: return [x for x in m.group(1).splitlines() if '[LINK-ERROR]' not in x] @@ -78,12 +82,11 @@ class LinkdecrypterCom(Crypter): retries -= 1 elif self.PASSWORD_PATTERN in self.html: - if self.passwords: - password = self.passwords.pop(0) - self.logInfo(_("Password protected link, trying ") + password) - self.html = self.load('http://linkdecrypter.com/', post={'password': password}, decode=True) + if self.password: + self.logInfo(_("Password protected link")) + self.html = self.load('http://linkdecrypter.com/', post={'password': self.password}, decode=True) else: - self.fail(_("No or incorrect password")) + self.fail(_("Missing password")) else: retries -= 1 |