diff options
Diffstat (limited to 'module/plugins/container')
-rw-r--r-- | module/plugins/container/CCF.py | 49 | ||||
-rw-r--r-- | module/plugins/container/DLC.py | 72 | ||||
-rw-r--r-- | module/plugins/container/LinkList.py | 69 | ||||
-rw-r--r-- | module/plugins/container/RSDF.py | 52 | ||||
-rw-r--r-- | module/plugins/container/__init__.py | 1 |
5 files changed, 0 insertions, 243 deletions
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py deleted file mode 100644 index 452b9bb65..000000000 --- a/module/plugins/container/CCF.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import re - -from urllib2 import build_opener - -from MultipartPostHandler import MultipartPostHandler - -from module.plugins.Container import Container -from module.utils import fs_encode, save_join - - -class CCF(Container): - __name__ = "CCF" - __type__ = "container" - __version__ = "0.23" - - __pattern__ = r'.+\.ccf$' - - __description__ = """CCF container decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("Willnix", "Willnix@pyload.org"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - def decrypt(self, pyfile): - file = fs_encode(pyfile.url.strip()) - opener = build_opener(MultipartPostHandler) - - dlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', - {'src' : "ccf", - 'filename': "test.ccf", - 'upload' : open(file, "rb")}).read() - - download_folder = self.config['general']['download_folder'] - dlc_file = save_join(download_folder, "tmp_%s.dlc" % pyfile.name) - - try: - dlc = re.search(r'<dlc>(.+)</dlc>', dlc_content, re.S).group(1).decode('base64') - - except AttributeError: - self.fail(_("Container is corrupted")) - - with open(dlc_file, "w") as tempdlc: - tempdlc.write(dlc) - - self.urls = [dlc_file] diff --git a/module/plugins/container/DLC.py b/module/plugins/container/DLC.py deleted file mode 100644 index b01e3098c..000000000 --- a/module/plugins/container/DLC.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import re -import xml.dom.minidom - -from Crypto.Cipher import AES - -from module.plugins.Container import Container -from module.utils import decode, fs_encode - - -class DLC(Container): - __name__ = "DLC" - __type__ = "container" - __version__ = "0.24" - - __pattern__ = r'.+\.dlc$' - - __description__ = """DLC container decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("spoob", "spoob@pyload.org"), - ("mkaay", "mkaay@mkaay.de"), - ("Schnusch", "Schnusch@users.noreply.github.com"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - KEY = "cb99b5cbc24db398" - IV = "9bc24cb995cb8db3" - API_URL = "http://service.jdownloader.org/dlcrypt/service.php?srcType=dlc&destType=pylo&data=%s" - - - def decrypt(self, pyfile): - file = fs_encode(pyfile.url.strip()) - with open(file) as dlc: - data = dlc.read().strip() - - data += '=' * (-len(data) % 4) - - dlc_key = data[-88:] - dlc_data = data[:-88].decode('base64') - dlc_content = self.load(self.API_URL % dlc_key) - - try: - rc = re.search(r'<rc>(.+)</rc>', dlc_content, re.S).group(1).decode('base64') - - except AttributeError: - self.fail(_("Container is corrupted")) - - cipher = AES.new(self.KEY, AES.MODE_CBC, self.IV).decrypt(rc) - - self.data = AES.new(cipher, AES.MODE_CBC, cipher).decrypt(dlc_data).decode('base64') - self.packages = [(entry[0] if entry[0] else pyfile.name, entry[1], entry[0] if entry[0] else pyfile.name) \ - for entry in self.getPackages()] - - - def getPackages(self): - root = xml.dom.minidom.parseString(self.data).documentElement - content = root.getElementsByTagName("content")[0] - return self.parsePackages(content) - - - def parsePackages(self, startNode): - return [(decode(node.getAttribute("name")).decode('base64'), self.parseLinks(node)) \ - for node in startNode.getElementsByTagName("package")] - - - def parseLinks(self, startNode): - return [node.getElementsByTagName("url")[0].firstChild.data.decode('base64') \ - for node in startNode.getElementsByTagName("file")] diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py deleted file mode 100644 index ccb9b2fa3..000000000 --- a/module/plugins/container/LinkList.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- - -import codecs - -from module.plugins.Container import Container -from module.utils import fs_encode - - -class LinkList(Container): - __name__ = "LinkList" - __type__ = "container" - __version__ = "0.14" - - __pattern__ = r'.+\.txt$' - __config__ = [("flush" , "bool" , "Flush list after adding", False ), - ("encoding", "string", "File encoding" , "utf-8")] - - __description__ = """Read link lists in txt format""" - __license__ = "GPLv3" - __authors__ = [("spoob", "spoob@pyload.org"), - ("jeix", "jeix@hasnomail.com")] - - - def decrypt(self, pyfile): - try: - encoding = codecs.lookup(self.getConfig("encoding")).name - - except Exception: - encoding = "utf-8" - - file = fs_encode(pyfile.url.strip()) - txt = codecs.open(file, 'r', encoding) - curPack = "Parsed links from %s" % pyfile.name - packages = {curPack:[],} - - for link in txt.readlines(): - link = link.strip() - - if not link: - continue - - if link.startswith(";"): - continue - - if link.startswith("[") and link.endswith("]"): - # new package - curPack = link[1:-1] - packages[curPack] = [] - continue - - packages[curPack].append(link) - - txt.close() - - # empty packages fix - for key, value in packages.iteritems(): - if not value: - packages.pop(key, None) - - if self.getConfig("flush"): - try: - txt = open(file, 'wb') - txt.close() - - except IOError: - self.logWarning(_("Failed to flush list")) - - for name, links in packages.iteritems(): - self.packages.append((name, links, name)) diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py deleted file mode 100644 index 8f9bfc0d5..000000000 --- a/module/plugins/container/RSDF.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import binascii -import re - -from Crypto.Cipher import AES - -from module.plugins.Container import Container -from module.utils import fs_encode - - -class RSDF(Container): - __name__ = "RSDF" - __type__ = "container" - __version__ = "0.27" - - __pattern__ = r'.+\.rsdf$' - - __description__ = """RSDF container decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("spoob", "spoob@pyload.org"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - KEY = "8C35192D964DC3182C6F84F3252239EB4A320D2500000000" - IV = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - - - def decrypt(self, pyfile): - KEY = binascii.unhexlify(self.KEY) - IV = AES.new(Key, AES.MODE_ECB).encrypt(binascii.unhexlify(self.IV)) - - cipher = AES.new(KEY, AES.MODE_CFB, IV) - - try: - file = fs_encode(pyfile.url.strip()) - with open(file, 'r') as rsdf: - data = rsdf.read() - - except IOError, e: - self.fail(e) - - if re.search(r"<title>404 - Not Found</title>", data): - return - - for link in binascii.unhexlify(''.join(data.split())).splitlines(): - if link: - link = cipher.decrypt(link.decode('base64')).replace('CCF: ', '') - self.urls.append(link) diff --git a/module/plugins/container/__init__.py b/module/plugins/container/__init__.py deleted file mode 100644 index 40a96afc6..000000000 --- a/module/plugins/container/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- |