diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-12-28 23:50:01 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-12-28 23:50:01 +0100 |
commit | fd4ff4ebf54b2697118434ff864fbed629dc4888 (patch) | |
tree | 0707804cc2d460845cca445e7c6a5b228f724321 /module/plugins/crypter | |
parent | Spare code fixes (3) (diff) | |
parent | Merge latest changes from original pyLoad repo (diff) | |
download | pyload-fd4ff4ebf54b2697118434ff864fbed629dc4888.tar.xz |
Merge branch 'pr/n2219_Arno-Nymous' into stable
Conflicts:
module/plugins/internal/Account.py
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/LinkCryptWs.py | 34 | ||||
-rw-r--r-- | module/plugins/crypter/ShareLinksBiz.py | 9 |
2 files changed, 18 insertions, 25 deletions
diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index ea8103ad7..0cdfa1e34 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -23,7 +23,8 @@ class LinkCryptWs(Crypter): __license__ = "GPLv3" __authors__ = [("kagenoshin", "kagenoshin[AT]gmx[DOT]ch"), ("glukgluk", None), - ("Gummibaer", None)] + ("Gummibaer", None), + ("Arno-Nymous", None)] CRYPTED_KEY = "crypted" @@ -106,7 +107,7 @@ class LinkCryptWs(Crypter): def is_captcha_protected(self): - if 'id="captcha">' in self.data: + if ('Linkcrypt.ws // Captx' in self.data) or ('Linkcrypt.ws // TextX' in self.data): self.log_debug("Links are captcha protected") return True else: @@ -131,7 +132,7 @@ class LinkCryptWs(Crypter): def unlock_captcha_protection(self): - captcha_url = re.search(r'<form.*?id\s*?=\s*?"captcha"[^>]*?>.*?<\s*?input.*?src="(.+?)"', self.data, re.I | re.S).group(1) + captcha_url = 'http://linkcrypt.ws/captx.html?secid=id=&id=' captcha_code = self.captcha.decrypt(captcha_url, input_type="gif", output_type='positional') self.data = self.load(self.pyfile.url, post={'x': captcha_code[0], 'y': captcha_code[1]}) @@ -147,15 +148,9 @@ class LinkCryptWs(Crypter): def getunrarpw(self): - sitein = self.data - indexi = sitein.find("|source|") + 8 - indexe = sitein.find("|", indexi) - - unrarpw = sitein[indexi:indexe] - - if unrarpw not in ("Password", "Dateipasswort"): - self.log_debug("File password set to: [%s]"% unrarpw) - self.pyfile.package().password = unrarpw + # Skip password parsing, since the method was not reliable due to the scrambling of the form data. + # That way one could not predict the exact position of the password at a certain index. + return def handle_errors(self): @@ -197,8 +192,8 @@ class LinkCryptWs(Crypter): try: res = self.load("http://linkcrypt.ws/out.html", post = {'file':weblink_id}) - indexs = res.find("window.location =") + 19 - indexe = res.find('"', indexs) + indexs = res.find("var url = ") + 11 + indexe = res.find("'", indexs) link2 = res[indexs:indexe] @@ -214,7 +209,7 @@ class LinkCryptWs(Crypter): def get_container_html(self): self.container_html = [] - script = re.search(r'<div.*?id="ad_cont".*?<script.*?javascrip[^>]*?>(.*?)</script', self.data, re.I | re.S) + script = re.search(r'<script.*?javascript[^>]*?>.*(eval.*?)\s*eval.*</script>.*<div class="clearfix', self.data, re.I | re.S) if script: container_html_text = script.group(1) @@ -260,7 +255,7 @@ class LinkCryptWs(Crypter): cnl_line = None for line in self.container_html: - if "cnl" in line: + if "addcrypted2" in line: cnl_line = line break @@ -282,7 +277,7 @@ class LinkCryptWs(Crypter): def _get_cipher_params(self, cnl_section): #: Get jk - jk_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkCryptWs.JK_KEY + jk_re = r'<INPUT.*?NAME="%s".*?VALUE="\D*(\d*)\D*"' % LinkCryptWs.JK_KEY vjk = re.findall(jk_re, cnl_section) #: Get crypted @@ -296,10 +291,9 @@ class LinkCryptWs(Crypter): def _get_links(self, crypted, jk): #: Get key - jreturn = self.js.eval("%s f()" % jk) - key = binascii.unhexlify(jreturn) + key = binascii.unhexlify(jk) - self.log_debug("JsEngine returns value [%s]" % jreturn) + self.log_debug("JsEngine returns value [%s]" % key) #: Decrypt Key = key diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 02d646d1c..2aa670a7e 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -11,7 +11,7 @@ from module.plugins.internal.Crypter import Crypter class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" - __version__ = "1.21" + __version__ = "1.22" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P<ID>_?\w+)' @@ -21,14 +21,14 @@ class ShareLinksBiz(Crypter): __description__ = """Share-Links.biz decrypter plugin""" __license__ = "GPLv3" - __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), + ("Arno-Nymous", None)] def setup(self): self.base_url = None self.file_id = None self.package = None - self.captcha = False def decrypt(self, pyfile): @@ -48,7 +48,6 @@ class ShareLinksBiz(Crypter): self.handle_errors() if self.is_captcha_protected(): - self.captcha = True self.unlock_captcha_protection() self.handle_errors() @@ -138,7 +137,7 @@ class ShareLinksBiz(Crypter): captchaUrl = self.base_url + '/captcha.gif?d=%s&PHPSESSID=%s' % (m.group(1), m.group(2)) self.log_debug("Waiting user for correct position") coords = self.captcha.decrypt(captchaUrl, input_type="gif", output_type='positional') - self.log_debug("Captcha resolved, coords %s" % coords) + self.log_debug("Captcha resolved! Coords: {}, {}".format(*coords)) #: Resolve captcha href = self._resolve_coords(coords, captchaMap) |