summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar fragonib <devnull@localhost> 2010-10-19 23:41:12 +0200
committerGravatar fragonib <devnull@localhost> 2010-10-19 23:41:12 +0200
commit82ec65c54acdbc433bf44b825eee32d4b3b7efe6 (patch)
tree1e17eb518438fb3ab6ca8276a937477102425394 /module
parentOneFichierCom hoster plugin regex bug fixes (diff)
downloadpyload-82ec65c54acdbc433bf44b825eee32d4b3b7efe6.tar.xz
New ReLinkUs crypter plugin version
Diffstat (limited to 'module')
-rw-r--r--module/plugins/crypter/RelinkUs.py121
1 files changed, 79 insertions, 42 deletions
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index e043e65a9..bf92168ee 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -1,58 +1,95 @@
#!/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 time
+import urllib
-from module.plugins.Crypter import Crypter
class RelinkUs(Crypter):
__name__ = "RelinkUs"
__type__ = "container"
__pattern__ = r"http://(www\.)?relink.us/(f|((view|go).php))"
- __version__ = "1.0"
+ __version__ = "2.0"
__description__ = """Relink.us Container Plugin"""
- __author_name__ = ("Sleeper-", "spoob")
- __author_mail__ = ("@nonymous", "spoob@pyload.org")
+ __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
+ (package_name, folder_name) = self.getNameAndFolder()
+
+ # Get package links
+ (crypted, jk) = self.getCipherParams()
+ package_links = self.getLinks(crypted, jk)
- def __init__(self, parent):
- Crypter.__init__(self, parent)
- self.parent = parent
- self.html = None
- self.multi_dl = False
+ # Pack
+ self.packages = [(package_name, package_links, folder_name)]
def file_exists(self):
- """ returns True or False
- """
+ if "sorry.png" in self.html:
+ return False
return True
+
+ def getCipherParams(self):
- def proceed(self, url, location):
- container_id = self.parent.url.split("/")[-1].split("id=")[-1]
- url = "http://relink.us/view.php?id="+container_id
- self.html = self.req.load(url, cookies=True)
- temp_links = []
-
- # Download Ad-Frames, otherwise we aren't enabled for download
- iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html)
- for iframe in iframes:
- self.req.load("http://relink.us/"+iframe[0], cookies=True)
-
- link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html)
-
- for link_string in link_strings:
- self.req.lastURL = url
-
- # Set Download File
- framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True)
-
- new_link = self.req.lastEffectiveURL
-
- if re.match(r"http://(www\.)?relink.us/",new_link):
- # Find iframe
- new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1)
- # Wait some secs for relink.us server...
- time.sleep(5)
-
- temp_links.append(new_link)
-
- self.links = temp_links
+ # Get vars dict
+ vars = {}
+ m = re.search(r'flashVars="(?P<vars>.*)"', self.html)
+ text = m.group('vars')
+ pairs = text.split('&')
+ for pair in pairs:
+ index = pair.index('=')
+ vars[pair[:index]] = pair[index + 1:]
+
+ # 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 (self.pyfile.package().name, self.pyfile.package().folder)
+
+ def getLinks(self, crypted, jk):
+
+ # Get key
+ rt = JsEngine.JsEngine()
+ jreturn = rt.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