diff options
Diffstat (limited to 'module/plugins/crypter/LinkdecrypterCom.py')
-rw-r--r-- | module/plugins/crypter/LinkdecrypterCom.py | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 2671c19c6..91318eadf 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -1,34 +1,23 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -""" - import re from module.plugins.Crypter import Crypter class LinkdecrypterCom(Crypter): - __name__ = "LinkdecrypterCom" + __name__ = "LinkdecrypterCom" + __type__ = "crypter" __version__ = "0.27" - __type__ = "crypter" - __pattern__ = None + __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""" - __author_name__ = ("zoidberg", "flowlee") - __author_mail__ = ("zoidberg@mujmail.cz", "") + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("flowlee", None)] + TEXTAREA_PATTERN = r'<textarea name="links" wrap="off" readonly="1" class="caja_des">(.+)</textarea>' PASSWORD_PATTERN = r'<input type="text" name="password"' @@ -37,16 +26,13 @@ class LinkdecrypterCom(Crypter): def decrypt(self, pyfile): - self.passwords = self.getPassword().splitlines() # API not working anymore self.urls = self.decryptHTML() - if not self.urls: - self.fail('Could not extract any links') - def decryptAPI(self): + def decryptAPI(self): get_dict = {"t": "link", "url": self.pyfile.url, "lcache": "1"} self.html = self.load('http://linkdecrypter.com/api', get=get_dict) if self.html.startswith('http://'): @@ -58,21 +44,21 @@ class LinkdecrypterCom(Crypter): if self.html.startswith('http://'): return self.html.splitlines() - self.logError('API', self.html) + self.logError("API", self.html) if self.html == 'INTERRUPTION(PASSWORD)': - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) return None - def decryptHTML(self): + def decryptHTML(self): retries = 5 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: - m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL) + 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] @@ -83,7 +69,7 @@ class LinkdecrypterCom(Crypter): m = re.search(r"<p><i><b>([^<]+)</b></i></p>", self.html) msg = m.group(1) if m else "" - self.logInfo("Captcha protected link", result_type, msg) + self.logInfo(_("Captcha protected link"), result_type, msg) captcha = self.decryptCaptcha(captcha_url, result_type=result_type) if result_type == "positional": @@ -94,10 +80,10 @@ class LinkdecrypterCom(Crypter): elif self.PASSWORD_PATTERN in self.html: if self.passwords: password = self.passwords.pop(0) - self.logInfo("Password protected link, trying " + password) + self.logInfo(_("Password protected link, trying ") + password) self.html = self.load('http://linkdecrypter.com/', post={'password': password}, decode=True) else: - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) else: retries -= 1 |