From ce1c2b6b05c08b669357947e61ae40efce7fc50f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 16 Feb 2015 10:46:28 +0100 Subject: module temp --- pyload/plugin/crypter/LinkdecrypterCom.py | 92 ------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 pyload/plugin/crypter/LinkdecrypterCom.py (limited to 'pyload/plugin/crypter/LinkdecrypterCom.py') diff --git a/pyload/plugin/crypter/LinkdecrypterCom.py b/pyload/plugin/crypter/LinkdecrypterCom.py deleted file mode 100644 index ab9bdbdc7..000000000 --- a/pyload/plugin/crypter/LinkdecrypterCom.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -from pyload.plugin.Crypter import Crypter - - -class LinkdecrypterCom(Crypter): - __name__ = "LinkdecrypterCom" - __type__ = "crypter" - __version__ = "0.27" - - __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""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("flowlee", "")] - - - TEXTAREA_PATTERN = r'' - PASSWORD_PATTERN = r'' - REDIR_PATTERN = r'(Click here if your browser does not redirect you).' - - - def decrypt(self, pyfile): - self.passwords = self.getPassword().splitlines() - - # API not working anymore - self.urls = self.decryptHTML() - - - 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://'): - 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() - - self.logError("API", self.html) - if self.html == 'INTERRUPTION(PASSWORD)': - self.fail(_("No or incorrect password")) - - return None - - - 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.S) - if m: - return [x for x in m.group(1).splitlines() if '[LINK-ERROR]' not in x] - - m = re.search(self.CAPTCHA_PATTERN, self.html) - if m: - captcha_url = 'http://linkdecrypter.com/' + m.group(1) - result_type = "positional" if "getPos" in m.group(2) else "textual" - - m = re.search(r"

([^<]+)

", self.html) - msg = m.group(1) if m else "" - self.logInfo(_("Captcha protected link"), result_type, msg) - - captcha = self.decryptCaptcha(captcha_url, result_type=result_type) - if result_type == "positional": - captcha = "%d|%d" % captcha - self.html = self.load('http://linkdecrypter.com/', post={"captcha": captcha}, decode=True) - 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) - else: - self.fail(_("No or incorrect password")) - - else: - retries -= 1 - self.html = self.load('http://linkdecrypter.com/', cookies=True, decode=True) - - return None -- cgit v1.2.3