summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/crypter/NCryptIn.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-10-11 18:13:15 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-10-11 18:42:38 +0200
commit7f46ff1b4b9494554924bb32b885d781d0ab1343 (patch)
tree240d994a4fd9f0d9a5444d2dbe0bc496e6b01788 /pyload/plugins/crypter/NCryptIn.py
parentLofCc: using ReCaptcha from CaptchaService (diff)
downloadpyload-7f46ff1b4b9494554924bb32b885d781d0ab1343.tar.xz
NCryptIn: ability to decrypt single encrypted links.
Requested in #303 (cherry picked from commit 6d183776d40a0b7feb6c6155402dc6baf43bf882)
Diffstat (limited to 'pyload/plugins/crypter/NCryptIn.py')
-rw-r--r--pyload/plugins/crypter/NCryptIn.py71
1 files changed, 43 insertions, 28 deletions
diff --git a/pyload/plugins/crypter/NCryptIn.py b/pyload/plugins/crypter/NCryptIn.py
index 74e0f02fb..170a5291d 100644
--- a/pyload/plugins/crypter/NCryptIn.py
+++ b/pyload/plugins/crypter/NCryptIn.py
@@ -12,11 +12,11 @@ from module.plugins.internal.CaptchaService import ReCaptcha
class NCryptIn(Crypter):
__name__ = "NCryptIn"
__type__ = "crypter"
- __pattern__ = r"http://(?:www\.)?ncrypt.in/folder-([^/\?]+)"
- __version__ = "1.24"
+ __pattern__ = r"http://(?:www\.)?ncrypt.in/(?P<type>folder|link|frame)-([^/\?]+)"
+ __version__ = "1.25"
__description__ = """NCrypt.in Crypter Plugin"""
- __author_name__ = ("fragonib")
- __author_mail__ = ("fragonib[AT]yahoo[DOT]es")
+ __author_name__ = ("fragonib", "stickell")
+ __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "l.stickell@yahoo.it")
# Constants
_JK_KEY_ = "jk"
@@ -33,31 +33,46 @@ class NCryptIn(Crypter):
# Init
self.package = pyfile.package()
- # Request package
- self.html = self.load(self.pyfile.url)
- self.cleanedHtml = self.removeCrap(self.html)
- if not self.isOnline():
- self.offline()
-
- # Check for protection
- if self.isProtected():
- self.html = self.unlockProtection()
+ self.type = re.search(self.__pattern__, pyfile.url).group('type')
+ if self.type in ('link', 'frame'):
+ self.handleSingle()
+ else:
+ # Request package
+ self.html = self.load(self.pyfile.url)
self.cleanedHtml = self.removeCrap(self.html)
- self.handleErrors()
-
- # Get package name and folder
- (package_name, folder_name) = self.getPackageInfo()
-
- # Extract package links
- package_links = []
- package_links.extend(self.handleWebLinks())
- package_links.extend(self.handleContainers())
- package_links.extend(self.handleCNL2())
- package_links = self.removeContainers(package_links)
- package_links = set(package_links)
-
- # Pack
- self.packages = [(package_name, package_links, folder_name)]
+ if not self.isOnline():
+ self.offline()
+
+ # Check for protection
+ if self.isProtected():
+ self.html = self.unlockProtection()
+ self.cleanedHtml = self.removeCrap(self.html)
+ self.handleErrors()
+
+ # Get package name and folder
+ (package_name, folder_name) = self.getPackageInfo()
+
+ # Extract package links
+ package_links = []
+ package_links.extend(self.handleWebLinks())
+ package_links.extend(self.handleContainers())
+ package_links.extend(self.handleCNL2())
+ package_links = self.removeContainers(package_links)
+ package_links = set(package_links)
+
+ # Pack
+ self.packages = [(package_name, package_links, folder_name)]
+
+ def handleSingle(self):
+ if self.type == 'link':
+ self.pyfile.url = self.pyfile.url.replace('link', 'frame')
+ header = self.load(self.pyfile.url, just_header=True)
+ if 'location' not in header:
+ self.fail("Unable to decrypt link")
+ loc = header['location']
+ self.logDebug("Link decrypted: " + loc)
+ self.package_links = [loc]
+ self.packages = [(self.package.name, self.package_links, self.package.folder)]
def removeCrap(self, content):
patterns = (r'(type="hidden".*?(name=".*?")?.*?value=".*?")',