From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/crypter/ShareLinksBiz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index f17ba54d7..aab898813 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -4,13 +4,13 @@ import binascii import re from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter +from module.plugins.internal.Crypter import Crypter class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" - __version__ = "1.14" + __version__ = "1.15" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P_?\w+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/crypter/ShareLinksBiz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index aab898813..2d72b513e 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -34,7 +34,7 @@ class ShareLinksBiz(Crypter): # Request package url = self.baseUrl + '/' + self.fileId - self.html = self.load(url, decode=True) + self.html = self.load(url) # Unblock server (load all images) self.unblockServer() @@ -104,7 +104,7 @@ class ShareLinksBiz(Crypter): self.logDebug("Submitting password [%s] for protected links" % password) post = {"password": password, 'login': 'Submit form'} url = self.baseUrl + '/' + self.fileId - self.html = self.load(url, post=post, decode=True) + self.html = self.load(url, post=post) def unlockCaptchaProtection(self): @@ -125,7 +125,7 @@ class ShareLinksBiz(Crypter): self.invalidCaptcha() self.retry(wait_time=5) url = self.baseUrl + href - self.html = self.load(url, decode=True) + self.html = self.load(url) def _getCaptchaMap(self): -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/crypter/ShareLinksBiz.py | 42 ++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 2d72b513e..250cc0c81 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -29,17 +29,17 @@ class ShareLinksBiz(Crypter): def decrypt(self, pyfile): - # Init + #: Init self.initFile(pyfile) - # Request package + #: Request package url = self.baseUrl + '/' + self.fileId self.html = self.load(url) - # Unblock server (load all images) + #: Unblock server (load all images) self.unblockServer() - # Check for protection + #: Check for protection if self.isPasswordProtected(): self.unlockPasswordProtection() self.handleErrors() @@ -49,17 +49,17 @@ class ShareLinksBiz(Crypter): self.unlockCaptchaProtection() self.handleErrors() - # Extract package links + #: Extract package links package_links = [] package_links.extend(self.handleWebLinks()) package_links.extend(self.handleContainers()) package_links.extend(self.handleCNL2()) package_links = set(package_links) - # Get package info + #: Get package info package_name, package_folder = self.getPackageInfo() - # Pack + #: Pack self.packages = [(package_name, package_links, package_folder)] @@ -108,18 +108,18 @@ class ShareLinksBiz(Crypter): def unlockCaptchaProtection(self): - # Get captcha map + #: Get captcha map captchaMap = self._getCaptchaMap() self.logDebug("Captcha map with [%d] positions" % len(captchaMap.keys())) - # Request user for captcha coords + #: Request user for captcha coords m = re.search(r'(.*)' m = re.search(title_re, self.html, re.S) if m: @@ -170,13 +170,13 @@ class ShareLinksBiz(Crypter): name = folder = title self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) - # Fallback to defaults + #: Fallback to defaults if not name or not folder: name = self.package.name folder = self.package.folder self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) - # Return package info + #: Return package info return name, folder @@ -240,40 +240,40 @@ class ShareLinksBiz(Crypter): def _getCipherParams(self): - # Request CNL2 + #: Request CNL2 code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1) url = "%s/get/cnl2/%s" % (self.baseUrl, code) res = self.load(url) params = res.split(";;") - # Get jk + #: Get jk strlist = list(params[1].decode('base64')) jk = ''.join(strlist[::-1]) - # Get crypted + #: Get crypted strlist = list(params[2].decode('base64')) crypted = ''.join(strlist[::-1]) - # Log and return + #: Log and return return crypted, jk def _getLinks(self, crypted, jk): - # Get key + #: Get key jreturn = self.js.eval("%s f()" % jk) self.logDebug("JsEngine returns value [%s]" % jreturn) key = binascii.unhexlify(jreturn) - # Decrypt + #: Decrypt Key = key IV = key obj = AES.new(Key, AES.MODE_CBC, IV) text = obj.decrypt(crypted.decode('base64')) - # Extract links + #: Extract links text = text.replace("\x00", "").replace("\r", "") links = filter(bool, text.split('\n')) - # Log and return + #: Log and return self.logDebug("Block has %d links" % len(links)) return links -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/crypter/ShareLinksBiz.py | 142 ++++++++++++++++---------------- 1 file changed, 71 insertions(+), 71 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 250cc0c81..9b435e694 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -10,7 +10,7 @@ from module.plugins.internal.Crypter import Crypter class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" - __version__ = "1.15" + __version__ = "1.16" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P_?\w+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), @@ -22,113 +22,113 @@ class ShareLinksBiz(Crypter): def setup(self): - self.baseUrl = None - self.fileId = None + self.base_url = None + self.file_id = None self.package = None self.captcha = False def decrypt(self, pyfile): #: Init - self.initFile(pyfile) + self.init_file(pyfile) #: Request package - url = self.baseUrl + '/' + self.fileId + url = self.base_url + '/' + self.file_id self.html = self.load(url) #: Unblock server (load all images) - self.unblockServer() + self.unblock_server() #: Check for protection - if self.isPasswordProtected(): - self.unlockPasswordProtection() - self.handleErrors() + if self.is_password_protected(): + self.unlock_password_protection() + self.handle_errors() - if self.isCaptchaProtected(): + if self.is_captcha_protected(): self.captcha = True - self.unlockCaptchaProtection() - self.handleErrors() + self.unlock_captcha_protection() + self.handle_errors() #: Extract package links package_links = [] - package_links.extend(self.handleWebLinks()) - package_links.extend(self.handleContainers()) - package_links.extend(self.handleCNL2()) + package_links.extend(self.handle_web_links()) + package_links.extend(self.handle_containers()) + package_links.extend(self.handle_CNL2()) package_links = set(package_links) #: Get package info - package_name, package_folder = self.getPackageInfo() + package_name, package_folder = self.get_package_info() #: Pack self.packages = [(package_name, package_links, package_folder)] - def initFile(self, pyfile): + def init_file(self, pyfile): url = pyfile.url if 's2l.biz' in url: url = self.load(url, just_header=True)['location'] - self.baseUrl = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) - self.fileId = re.match(self.__pattern__, url).group('ID') + self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) + self.file_id = re.match(self.__pattern__, url).group('ID') self.package = pyfile.package() - def isOnline(self): + def is_online(self): if "No usable content was found" in self.html: - self.logDebug("File not found") + self.log_debug("File not found") return False return True - def isPasswordProtected(self): + def is_password_protected(self): if re.search(r'''''', self.html): - self.logDebug("Links are protected") + self.log_debug("Links are protected") return True return False - def isCaptchaProtected(self): + def is_captcha_protected(self): if '\s*eval\((.*)\)\s*', res, re.S).group(1) @@ -205,44 +205,44 @@ class ShareLinksBiz(Crypter): dlLink = self.js.eval(jslauncher % jscode) - self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) + self.log_debug("JsEngine returns value [%s] for redirection link" % dlLink) package_links.append(dlLink) except Exception, detail: - self.logDebug("Error decrypting Web link [%s], %s" % (ID, detail)) + self.log_debug("Error decrypting Web link [%s], %s" % (ID, detail)) return package_links - def handleContainers(self): + def handle_containers(self): package_links = [] - self.logDebug("Handling Container links") + self.log_debug("Handling Container links") pattern = r'javascript:_get\(\'(.*?)\', 0, \'(rsdf|ccf|dlc)\'\)' containersLinks = re.findall(pattern, self.html) - self.logDebug("Decrypting %d Container links" % len(containersLinks)) + self.log_debug("Decrypting %d Container links" % len(containersLinks)) for containerLink in containersLinks: - link = "%s/get/%s/%s" % (self.baseUrl, containerLink[1], containerLink[0]) + link = "%s/get/%s/%s" % (self.base_url, containerLink[1], containerLink[0]) package_links.append(link) return package_links - def handleCNL2(self): + def handle_CNL2(self): package_links = [] - self.logDebug("Handling CNL2 links") + self.log_debug("Handling CNL2 links") if '/lib/cnl2/ClicknLoad.swf' in self.html: try: - (crypted, jk) = self._getCipherParams() - package_links.extend(self._getLinks(crypted, jk)) + (crypted, jk) = self._get_cipher_params() + package_links.extend(self._get_links(crypted, jk)) except Exception: self.fail(_("Unable to decrypt CNL2 links")) return package_links - def _getCipherParams(self): + def _get_cipher_params(self): #: Request CNL2 code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1) - url = "%s/get/cnl2/%s" % (self.baseUrl, code) + url = "%s/get/cnl2/%s" % (self.base_url, code) res = self.load(url) params = res.split(";;") @@ -258,10 +258,10 @@ class ShareLinksBiz(Crypter): return crypted, jk - def _getLinks(self, crypted, jk): + def _get_links(self, crypted, jk): #: Get key jreturn = self.js.eval("%s f()" % jk) - self.logDebug("JsEngine returns value [%s]" % jreturn) + self.log_debug("JsEngine returns value [%s]" % jreturn) key = binascii.unhexlify(jreturn) #: Decrypt @@ -275,5 +275,5 @@ class ShareLinksBiz(Crypter): links = filter(bool, text.split('\n')) #: Log and return - self.logDebug("Block has %d links" % len(links)) + self.log_debug("Block has %d links" % len(links)) return links -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/crypter/ShareLinksBiz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 9b435e694..1a26080bc 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -80,7 +80,7 @@ class ShareLinksBiz(Crypter): def is_password_protected(self): - if re.search(r'''''', self.html): + if re.search(r'', self.html): self.log_debug("Links are protected") return True return False @@ -102,7 +102,7 @@ class ShareLinksBiz(Crypter): def unlock_password_protection(self): password = self.get_password() self.log_debug("Submitting password [%s] for protected links" % password) - post = {"password": password, 'login': 'Submit form'} + post = {'password': password, 'login': 'Submit form'} url = self.base_url + '/' + self.file_id self.html = self.load(url, post=post) @@ -248,11 +248,11 @@ class ShareLinksBiz(Crypter): #: Get jk strlist = list(params[1].decode('base64')) - jk = ''.join(strlist[::-1]) + jk = "".join(strlist[::-1]) #: Get crypted strlist = list(params[2].decode('base64')) - crypted = ''.join(strlist[::-1]) + crypted = "".join(strlist[::-1]) #: Log and return return crypted, jk -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/crypter/ShareLinksBiz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 1a26080bc..d717431a6 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -11,6 +11,7 @@ class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" __version__ = "1.16" + __status__ = "stable" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P_?\w+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), -- cgit v1.2.3 From 027cb529d79558de19c47da88a782b31745a65c9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 21 Jul 2015 22:53:37 +0200 Subject: New Captcha skeleton --- module/plugins/crypter/ShareLinksBiz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index d717431a6..894b6d010 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -117,13 +117,13 @@ class ShareLinksBiz(Crypter): m = re.search(r' Date: Thu, 23 Jul 2015 23:44:45 +0200 Subject: Improve Captcha --- module/plugins/crypter/ShareLinksBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 894b6d010..82fc6285e 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -117,7 +117,7 @@ class ShareLinksBiz(Crypter): m = re.search(r' Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/crypter/ShareLinksBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 82fc6285e..d9c31dc5b 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -11,7 +11,7 @@ class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" __version__ = "1.16" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P_?\w+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), -- cgit v1.2.3 From 952001324e1faf584b1adcb01c4a0406a3722932 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:42:49 +0200 Subject: =?UTF-8?q?Don't=20user=20dictionary=E2=80=99s=20iterator=20method?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/plugins/crypter/ShareLinksBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index d9c31dc5b..b9ddd953f 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -140,7 +140,7 @@ class ShareLinksBiz(Crypter): def _resolve_coords(self, coords, captchaMap): x, y = coords - for rect, href in captchaMap.iteritems(): + for rect, href in captchaMap.items(): x1, y1, x2, y2 = rect if (x >= x1 and x <= x2) and (y >= y1 and y <= y2): return href -- cgit v1.2.3 From dc47212c8e801d380e4db4bd1bec0bf183de9de1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 31 Jul 2015 05:48:44 +0200 Subject: [Captcha] Fix _decrypt method --- module/plugins/crypter/ShareLinksBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index b9ddd953f..6fbe59b38 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -117,7 +117,7 @@ class ShareLinksBiz(Crypter): m = re.search(r'