diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-20 12:40:24 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-20 12:40:24 +0200 |
commit | 31afd7b36a057a73e15756ef58cdd61d69a4c9a9 (patch) | |
tree | ddd81b20c21d465b3ec3f57b78e0d03c0a473848 /module/plugins/crypter | |
parent | New ReLinkUs crypter plugin version (diff) | |
download | pyload-31afd7b36a057a73e15756ef58cdd61d69a4c9a9.tar.xz |
closed #159
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/RelinkUs.py | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index bf92168ee..ddecaf280 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -1,14 +1,14 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from Crypto.Cipher import AES -from module import JsEngine -from module.plugins.Crypter import Crypter import base64 import binascii import re import urllib +from Crypto.Cipher import AES + +from module.plugins.Crypter import Crypter class RelinkUs(Crypter): __name__ = "RelinkUs" @@ -18,33 +18,33 @@ class RelinkUs(Crypter): __description__ = """Relink.us Container Plugin""" __author_name__ = ("Sleeper-", "spoob", "fragonib") __author_mail__ = ("@nonymous", "spoob@pyload.org", "fragonib@yahoo.es") - + # Constants _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" def decrypt(self, pyfile): - + # Request page self.html = self.load(pyfile.url) if not self.file_exists(): self.offline() - - # Get package name and folder + + # Get package name and folder (package_name, folder_name) = self.getNameAndFolder() - + # Get package links (crypted, jk) = self.getCipherParams() package_links = self.getLinks(crypted, jk) - # Pack + # Pack self.packages = [(package_name, package_links, folder_name)] def file_exists(self): if "sorry.png" in self.html: return False return True - + def getCipherParams(self): # Get vars dict @@ -55,41 +55,39 @@ class RelinkUs(Crypter): for pair in pairs: index = pair.index('=') vars[pair[:index]] = pair[index + 1:] - - # Extract cipher pair + + # Extract cipher pair jk = urllib.unquote(vars[RelinkUs._JK_KEY_].replace("+", " ")) crypted = vars[RelinkUs._CRYPTED_KEY_] - + return (crypted, jk) - + def getNameAndFolder(self): title_re = r'<td class="top">Title</td><td class="top">\|</td><td><span class="info_view_id"><i>(?P<title>.*)</i></span></td>' m = re.search(title_re, self.html) if m is not None: title = m.group('title') - return (title, title) + return (title, title) return (self.pyfile.package().name, self.pyfile.package().folder) - + def getLinks(self, crypted, jk): - + # Get key - rt = JsEngine.JsEngine() - jreturn = rt.eval("%s f()" % jk) + jreturn = self.js.eval("%s f()" % jk) 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) - + # Extract links text = text.replace("\x00", "").replace("\r", "") links = text.split("\n") links = filter(lambda x: x != "", links) - + return links -
\ No newline at end of file |