From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/crypter/NCryptIn.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index eacd4aa8d..cadf2760f 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -32,7 +32,6 @@ class NCryptIn(Crypter): self.protection_type = None def decrypt(self, pyfile): - # Init self.package = pyfile.package() package_links = [] @@ -75,7 +74,7 @@ class NCryptIn(Crypter): def isSingleLink(self): link_type = re.match(self.__pattern__, self.pyfile.url).group('type') - return link_type in ('link', 'frame') + return link_type in ("link", "frame") def requestFolderHome(self): return self.load(self.pyfile.url, decode=True) @@ -163,7 +162,6 @@ class NCryptIn(Crypter): return self.load(self.pyfile.url, post=postData, decode=True) def handleErrors(self): - if self.protection_type == "password": if "This password is invalid!" in self.cleanedHtml: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") @@ -178,9 +176,8 @@ class NCryptIn(Crypter): self.correctCaptcha() def handleLinkSource(self, link_source_type): - # Check for JS engine - require_js_engine = link_source_type in ('cnl2', 'rsdf', 'ccf', 'dlc') + require_js_engine = link_source_type in ("cnl2", "rsdf", "ccf", "dlc") if require_js_engine and not self.js: self.logDebug("No JS engine available, skip %s links" % link_source_type) return [] @@ -190,9 +187,9 @@ class NCryptIn(Crypter): return self.handleSingleLink() if link_source_type == 'cnl2': return self.handleCNL2() - elif link_source_type in ('rsdf', 'ccf', 'dlc'): + elif link_source_type in ("rsdf", "ccf", "dlc"): return self.handleContainer(link_source_type) - elif link_source_type == 'web': + elif link_source_type == "web": return self.handleWebLinks() else: self.fail('unknown source type "%s" (this is probably a bug)' % link_source_type) @@ -279,7 +276,6 @@ class NCryptIn(Crypter): return vcrypted, vjk def _getLinks(self, crypted, jk): - # Get key jreturn = self.js.eval("%s f()" % jk) self.logDebug("JsEngine returns value [%s]" % jreturn) -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/crypter/NCryptIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index cadf2760f..ec6533ffc 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -28,7 +28,7 @@ class NCryptIn(Crypter): self.package = None self.html = None self.cleanedHtml = None - self.links_source_order = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web'] + self.links_source_order = ["cnl2", "rsdf", "ccf", "dlc", "web"] self.protection_type = None def decrypt(self, pyfile): -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/crypter/NCryptIn.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index ec6533ffc..dc2f29519 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -5,25 +5,28 @@ import binascii import re from Crypto.Cipher import AES + from module.plugins.Crypter import Crypter from module.plugins.internal.CaptchaService import ReCaptcha class NCryptIn(Crypter): __name__ = "NCryptIn" + __version__ = "1.32" __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?ncrypt.in/(?Pfolder|link|frame)-([^/\?]+)' - __version__ = "1.32" + __description__ = """NCrypt.in decrypter plugin""" __author_name__ = ("fragonib", "stickell") __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "l.stickell@yahoo.it") - # Constants - _JK_KEY_ = "jk" - _CRYPTED_KEY_ = "crypted" + JK_KEY = "jk" + CRYPTED_KEY = "crypted" NAME_PATTERN = r' Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/crypter/NCryptIn.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index dc2f29519..f9953b994 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -100,20 +100,20 @@ class NCryptIn(Crypter): return True def isProtected(self): - form_match = re.search(r'(.*?)', self.cleanedHtml, re.DOTALL) - if form_match: - form_content = form_match.group(1) + form = re.search(r'(.*?)', self.cleanedHtml, re.DOTALL) + if form is not None: + content = form.group(1) for keyword in ("password", "captcha"): - if keyword in form_content: + if keyword in content: self.protection_type = keyword self.logDebug("Links are %s protected" % self.protection_type) return True return False def getPackageInfo(self): - m = re.search(self.NAME_PATTERN, self.html) - if m: - name = folder = m.group('N').strip() + found = re.search(self.NAME_PATTERN, self.html) + if found: + name = folder = found.group('N').strip() self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) else: name = self.package.name -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/crypter/NCryptIn.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index f9953b994..9a9d76f51 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -95,7 +95,7 @@ class NCryptIn(Crypter): def isOnline(self): if "Your folder does not exist" in self.cleanedHtml: - self.logDebug("File not found") + self.logDebug("File not m") return False return True @@ -111,14 +111,14 @@ class NCryptIn(Crypter): return False def getPackageInfo(self): - found = re.search(self.NAME_PATTERN, self.html) - if found: - name = folder = found.group('N').strip() + m = re.search(self.NAME_PATTERN, self.html) + if m: + name = folder = m.group('N').strip() self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) else: name = self.package.name folder = self.package.folder - self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) + self.logDebug("Package info not m, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) return name, folder def unlockProtection(self): -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/crypter/NCryptIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 9a9d76f51..1b7b8b3d4 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -12,8 +12,8 @@ from module.plugins.internal.CaptchaService import ReCaptcha class NCryptIn(Crypter): __name__ = "NCryptIn" - __version__ = "1.32" __type__ = "crypter" + __version__ = "1.32" __pattern__ = r'http://(?:www\.)?ncrypt.in/(?Pfolder|link|frame)-([^/\?]+)' @@ -54,7 +54,7 @@ class NCryptIn(Crypter): if not self.isOnline(): self.offline() - # Check for folder protection + # Check for folder protection if self.isProtected(): self.html = self.unlockProtection() self.cleanedHtml = self.removeHtmlCrap(self.html) @@ -141,7 +141,7 @@ class NCryptIn(Crypter): self.logDebug("Captcha resolved [%s]" % captcha) postData['captcha'] = captcha - # Resolve recaptcha + # Resolve recaptcha if "recaptcha" in form: self.logDebug("ReCaptcha protected") captcha_key = re.search(r'\?k=(.*?)"', form).group(1) -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/crypter/NCryptIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 1b7b8b3d4..3937299d0 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -156,7 +156,7 @@ class NCryptIn(Crypter): self.logDebug("CircleCaptcha protected") captcha_img_url = "http://ncrypt.in/classes/captcha/circlecaptcha.php" coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') - self.logDebug("Captcha resolved, coords [%s]" % str(coords)) + self.logDebug("Captcha resolved, coords [%s]" % coords) postData['circle.x'] = coords[0] postData['circle.y'] = coords[1] -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/crypter/NCryptIn.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 3937299d0..1a6757006 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -18,8 +18,9 @@ class NCryptIn(Crypter): __pattern__ = r'http://(?:www\.)?ncrypt.in/(?Pfolder|link|frame)-([^/\?]+)' __description__ = """NCrypt.in decrypter plugin""" - __author_name__ = ("fragonib", "stickell") - __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "l.stickell@yahoo.it") + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), + ("stickell", "l.stickell@yahoo.it")] + JK_KEY = "jk" CRYPTED_KEY = "crypted" -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/crypter/NCryptIn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 1a6757006..22d496913 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -18,6 +18,7 @@ class NCryptIn(Crypter): __pattern__ = r'http://(?:www\.)?ncrypt.in/(?Pfolder|link|frame)-([^/\?]+)' __description__ = """NCrypt.in decrypter plugin""" + __license__ = "GPLv3" __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), ("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/crypter/NCryptIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 22d496913..8b8d2ebd4 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -231,7 +231,7 @@ class NCryptIn(Crypter): self.logDebug("Handling Container links") package_links = [] - pattern = r"/container/(rsdf|dlc|ccf)/([a-z0-9]+)" + pattern = r"/container/(rsdf|dlc|ccf)/(\w+)" containersLinks = re.findall(pattern, self.html) self.logDebug("Decrypting %d Container links" % len(containersLinks)) for containerLink in containersLinks: -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/crypter/NCryptIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 8b8d2ebd4..9eb242363 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -15,7 +15,7 @@ class NCryptIn(Crypter): __type__ = "crypter" __version__ = "1.32" - __pattern__ = r'http://(?:www\.)?ncrypt.in/(?Pfolder|link|frame)-([^/\?]+)' + __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?Pfolder|link|frame)-([^/\?]+)' __description__ = """NCrypt.in decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8939f015a688a07ec7d0bd14b6a3704f6a2cb4a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- module/plugins/crypter/NCryptIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 9eb242363..64ce973e8 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -231,7 +231,7 @@ class NCryptIn(Crypter): self.logDebug("Handling Container links") package_links = [] - pattern = r"/container/(rsdf|dlc|ccf)/(\w+)" + pattern = r'/container/(rsdf|dlc|ccf)/(\w+)' containersLinks = re.findall(pattern, self.html) self.logDebug("Decrypting %d Container links" % len(containersLinks)) for containerLink in containersLinks: @@ -243,7 +243,7 @@ class NCryptIn(Crypter): def handleWebLinks(self): self.logDebug("Handling Web links") - pattern = r"(http://ncrypt\.in/link-.*?=)" + pattern = r'(http://ncrypt\.in/link-.*?=)' links = re.findall(pattern, self.html) package_links = [] -- cgit v1.2.3 From 477120dfa8090f808ce17267896456c082714203 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Oct 2014 19:09:49 +0200 Subject: Fixed logging issue with coords values --- module/plugins/crypter/NCryptIn.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 64ce973e8..22fd53384 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -13,7 +13,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class NCryptIn(Crypter): __name__ = "NCryptIn" __type__ = "crypter" - __version__ = "1.32" + __version__ = "1.33" __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?Pfolder|link|frame)-([^/\?]+)' @@ -36,6 +36,7 @@ class NCryptIn(Crypter): self.links_source_order = ["cnl2", "rsdf", "ccf", "dlc", "web"] self.protection_type = None + def decrypt(self, pyfile): # Init self.package = pyfile.package() @@ -77,13 +78,16 @@ class NCryptIn(Crypter): self.fail('Could not extract any links') self.packages = [(package_name, package_links, folder_name)] + def isSingleLink(self): link_type = re.match(self.__pattern__, self.pyfile.url).group('type') return link_type in ("link", "frame") + def requestFolderHome(self): return self.load(self.pyfile.url, decode=True) + def removeHtmlCrap(self, content): patterns = (r'(type="hidden".*?(name=".*?")?.*?value=".*?")', r'display:none;">(.*?)', @@ -95,12 +99,14 @@ class NCryptIn(Crypter): content = re.sub(rexpr, "", content) return content + def isOnline(self): if "Your folder does not exist" in self.cleanedHtml: self.logDebug("File not m") return False return True + def isProtected(self): form = re.search(r'(.*?)', self.cleanedHtml, re.DOTALL) if form is not None: @@ -112,6 +118,7 @@ class NCryptIn(Crypter): return True return False + def getPackageInfo(self): m = re.search(self.NAME_PATTERN, self.html) if m: @@ -123,6 +130,7 @@ class NCryptIn(Crypter): self.logDebug("Package info not m, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) return name, folder + def unlockProtection(self): postData = {} @@ -158,7 +166,7 @@ class NCryptIn(Crypter): self.logDebug("CircleCaptcha protected") captcha_img_url = "http://ncrypt.in/classes/captcha/circlecaptcha.php" coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') - self.logDebug("Captcha resolved, coords [%s]" % coords) + self.logDebug("Captcha resolved, coords [%s]" % str(coords)) postData['circle.x'] = coords[0] postData['circle.y'] = coords[1] @@ -166,6 +174,7 @@ class NCryptIn(Crypter): postData['submit_protected'] = 'Continue to folder' return self.load(self.pyfile.url, post=postData, decode=True) + def handleErrors(self): if self.protection_type == "password": if "This password is invalid!" in self.cleanedHtml: @@ -180,6 +189,7 @@ class NCryptIn(Crypter): else: self.correctCaptcha() + def handleLinkSource(self, link_source_type): # Check for JS engine require_js_engine = link_source_type in ("cnl2", "rsdf", "ccf", "dlc") @@ -199,6 +209,7 @@ class NCryptIn(Crypter): else: self.fail('unknown source type "%s" (this is probably a bug)' % link_source_type) + def handleSingleLink(self): self.logDebug("Handling Single link") @@ -211,6 +222,7 @@ class NCryptIn(Crypter): return package_links + def handleCNL2(self): self.logDebug("Handling CNL2 links") @@ -226,6 +238,7 @@ class NCryptIn(Crypter): return package_links + def handleContainers(self): self.logDebug("Handling Container links") @@ -240,6 +253,7 @@ class NCryptIn(Crypter): return package_links + def handleWebLinks(self): self.logDebug("Handling Web links") @@ -256,6 +270,7 @@ class NCryptIn(Crypter): return package_links + def decryptLink(self, link): try: url = link.replace("link-", "frame-") @@ -264,6 +279,7 @@ class NCryptIn(Crypter): except Exception, detail: self.logDebug("Error decrypting link %s, %s" % (link, detail)) + def _getCipherParams(self): pattern = r' Date: Tue, 21 Oct 2014 16:01:05 +0200 Subject: Remove needless self.html --- module/plugins/crypter/NCryptIn.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 22fd53384..28a0735a5 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -31,7 +31,6 @@ class NCryptIn(Crypter): def setup(self): self.package = None - self.html = None self.cleanedHtml = None self.links_source_order = ["cnl2", "rsdf", "ccf", "dlc", "web"] self.protection_type = None -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/crypter/NCryptIn.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 28a0735a5..ef696dbd8 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -131,7 +131,6 @@ class NCryptIn(Crypter): def unlockProtection(self): - postData = {} form = re.search(r'
', self.cleanedHtml, re.DOTALL).group(1) @@ -210,7 +209,6 @@ class NCryptIn(Crypter): def handleSingleLink(self): - self.logDebug("Handling Single link") package_links = [] @@ -223,7 +221,6 @@ class NCryptIn(Crypter): def handleCNL2(self): - self.logDebug("Handling CNL2 links") package_links = [] @@ -239,7 +236,6 @@ class NCryptIn(Crypter): def handleContainers(self): - self.logDebug("Handling Container links") package_links = [] @@ -254,7 +250,6 @@ class NCryptIn(Crypter): def handleWebLinks(self): - self.logDebug("Handling Web links") pattern = r'(http://ncrypt\.in/link-.*?=)' links = re.findall(pattern, self.html) @@ -280,7 +275,6 @@ class NCryptIn(Crypter): def _getCipherParams(self): - pattern = r' Date: Thu, 23 Oct 2014 22:34:36 +0200 Subject: Call error instead fail in some plugins --- module/plugins/crypter/NCryptIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index ef696dbd8..54b6eeba2 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -205,7 +205,7 @@ class NCryptIn(Crypter): elif link_source_type == "web": return self.handleWebLinks() else: - self.fail('unknown source type "%s" (this is probably a bug)' % link_source_type) + self.error('unknown source type "%s" (this is probably a bug)' % link_source_type) def handleSingleLink(self): -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/crypter/NCryptIn.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 54b6eeba2..6c31a19f1 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -94,7 +94,7 @@ class NCryptIn(Crypter): r'(.*?)
', r'') for pattern in patterns: - rexpr = re.compile(pattern, re.DOTALL) + rexpr = re.compile(pattern, re.S) content = re.sub(rexpr, "", content) return content @@ -107,7 +107,7 @@ class NCryptIn(Crypter): def isProtected(self): - form = re.search(r'(.*?)', self.cleanedHtml, re.DOTALL) + form = re.search(r'(.*?)', self.cleanedHtml, re.S) if form is not None: content = form.group(1) for keyword in ("password", "captcha"): @@ -133,7 +133,7 @@ class NCryptIn(Crypter): def unlockProtection(self): postData = {} - form = re.search(r'
', self.cleanedHtml, re.DOTALL).group(1) + form = re.search(r'', self.cleanedHtml, re.S).group(1) # Submit package password if "password" in form: @@ -181,7 +181,6 @@ class NCryptIn(Crypter): if self.protection_type == "captcha": if "The securitycheck was wrong!" in self.cleanedHtml: - self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.retry() else: @@ -205,7 +204,7 @@ class NCryptIn(Crypter): elif link_source_type == "web": return self.handleWebLinks() else: - self.error('unknown source type "%s" (this is probably a bug)' % link_source_type) + self.error('Unknown source type "%s" (this is probably a bug)' % link_source_type) def handleSingleLink(self): -- cgit v1.2.3 From e3f5280529921100f48bb8a79853bf480c7611e4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 02:53:05 +0200 Subject: Replace single quotes with doubles in self.error and self.fail msg --- module/plugins/crypter/NCryptIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 6c31a19f1..a9f04f45f 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -74,7 +74,7 @@ class NCryptIn(Crypter): # Pack and return links if not package_links: - self.fail('Could not extract any links') + self.fail("Could not extract any links") self.packages = [(package_name, package_links, folder_name)] -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/crypter/NCryptIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index a9f04f45f..801afc50b 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -74,7 +74,7 @@ class NCryptIn(Crypter): # Pack and return links if not package_links: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) self.packages = [(package_name, package_links, folder_name)] @@ -177,7 +177,7 @@ class NCryptIn(Crypter): if self.protection_type == "password": if "This password is invalid!" in self.cleanedHtml: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail(_("Incorrect password, please set right password on 'Edit package' form and retry")) if self.protection_type == "captcha": if "The securitycheck was wrong!" in self.cleanedHtml: @@ -229,7 +229,7 @@ class NCryptIn(Crypter): for (crypted, jk) in zip(vcrypted, vjk): package_links.extend(self._getLinks(crypted, jk)) except: - self.fail("Unable to decrypt CNL2 links") + self.fail(_("Unable to decrypt CNL2 links")) return package_links -- cgit v1.2.3 From aa0751bcfd995e308bcd586a6965c75e68b1274b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Oct 2014 23:05:13 +0100 Subject: Code cosmetics --- module/plugins/crypter/NCryptIn.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 801afc50b..7d82cba7a 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -73,9 +73,8 @@ class NCryptIn(Crypter): package_links = set(package_links) # Pack and return links - if not package_links: - self.fail(_("Could not extract any links")) - self.packages = [(package_name, package_links, folder_name)] + if package_links: + self.packages = [(package_name, package_links, folder_name)] def isSingleLink(self): -- cgit v1.2.3 From 885f8ed782e64d9e73367905e642a84d0a8999f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 04:01:38 +0100 Subject: Update __config__ --- module/plugins/crypter/NCryptIn.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 7d82cba7a..9687e75c1 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -16,6 +16,8 @@ class NCryptIn(Crypter): __version__ = "1.33" __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?Pfolder|link|frame)-([^/\?]+)' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """NCrypt.in decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/crypter/NCryptIn.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 9687e75c1..3c08e26c1 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -11,8 +11,8 @@ from module.plugins.internal.CaptchaService import ReCaptcha class NCryptIn(Crypter): - __name__ = "NCryptIn" - __type__ = "crypter" + __name__ = "NCryptIn" + __type__ = "crypter" __version__ = "1.33" __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?Pfolder|link|frame)-([^/\?]+)' @@ -20,9 +20,9 @@ class NCryptIn(Crypter): ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """NCrypt.in decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), - ("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), + ("stickell", "l.stickell@yahoo.it")] JK_KEY = "jk" -- cgit v1.2.3 From 4d578cb15f3d6edd036e438e504739b97660f93e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 16:58:35 +0100 Subject: Spare code cosmetics --- module/plugins/crypter/NCryptIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 3c08e26c1..1d572e538 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -156,9 +156,9 @@ class NCryptIn(Crypter): captcha_key = re.search(r'\?k=(.*?)"', form).group(1) self.logDebug("Resolving ReCaptcha with key [%s]" % captcha_key) recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(captcha_key) + challenge, response = recaptcha.challenge(captcha_key) postData['recaptcha_challenge_field'] = challenge - postData['recaptcha_response_field'] = code + postData['recaptcha_response_field'] = response # Resolve circlecaptcha if "circlecaptcha" in form: -- cgit v1.2.3 From 854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 22 Dec 2014 16:45:04 +0100 Subject: Spare code cosmetics --- module/plugins/crypter/NCryptIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NCryptIn.py') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 1d572e538..8b7214157 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -15,7 +15,7 @@ class NCryptIn(Crypter): __type__ = "crypter" __version__ = "1.33" - __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?Pfolder|link|frame)-([^/\?]+)' + __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?Pfolder|link|frame)-([^/\?]+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -80,7 +80,7 @@ class NCryptIn(Crypter): def isSingleLink(self): - link_type = re.match(self.__pattern__, self.pyfile.url).group('type') + link_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE') return link_type in ("link", "frame") -- cgit v1.2.3