summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/NCryptIn.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter/NCryptIn.py')
-rw-r--r--module/plugins/crypter/NCryptIn.py21
1 files changed, 19 insertions, 2 deletions
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/(?P<type>folder|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;">(.*?)</(div|span)>',
@@ -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'<form.*?name.*?protected.*?>(.*?)</form>', 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'<input.*?name="%s".*?value="(.*?)"'
@@ -280,6 +296,7 @@ class NCryptIn(Crypter):
self.logDebug("Detected %d crypted blocks" % len(vcrypted))
return vcrypted, vjk
+
def _getLinks(self, crypted, jk):
# Get key
jreturn = self.js.eval("%s f()" % jk)