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.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 415e2785a..29b45b11a 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
-import base64
import binascii
import re
@@ -13,9 +12,9 @@ from pyload.plugin.internal.captcha import ReCaptcha
class NCryptIn(Crypter):
__name__ = "NCryptIn"
__type__ = "crypter"
- __version__ = "1.33"
+ __version__ = "1.34"
- __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<type>folder|link|frame)-([^/\?]+)'
+ __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<TYPE>folder|link|frame)-([^/\?]+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -80,7 +79,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")
@@ -156,7 +155,7 @@ 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, response = recaptcha.challenge(captcha_key)
+ response, challenge = recaptcha.challenge(captcha_key)
postData['recaptcha_challenge_field'] = challenge
postData['recaptcha_response_field'] = response
@@ -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"') % link_source_type)
def handleSingleLink(self):
@@ -296,19 +295,15 @@ class NCryptIn(Crypter):
self.logDebug("JsEngine returns value [%s]" % jreturn)
key = binascii.unhexlify(jreturn)
- # Decode crypted
- crypted = base64.standard_b64decode(crypted)
-
# Decrypt
Key = key
IV = key
obj = AES.new(Key, AES.MODE_CBC, IV)
- text = obj.decrypt(crypted)
+ text = obj.decrypt(crypted.decode('base64'))
# Extract links
text = text.replace("\x00", "").replace("\r", "")
- links = text.split("\n")
- links = filter(lambda x: x != "", links)
+ links = filter(bool, text.split('\n'))
# Log and return
self.logDebug("Block has %d links" % len(links))