diff options
author | mkaay <mkaay@mkaay.de> | 2009-12-27 00:20:21 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2009-12-27 00:20:21 +0100 |
commit | 8e87787753b2e049917a5491727d285b1c5a7095 (patch) | |
tree | 9b23fb14b0f1270edc4582758bcf3a39cfd97b67 /module/plugins/container | |
parent | closes #42 (diff) | |
download | pyload-8e87787753b2e049917a5491727d285b1c5a7095.tar.xz |
closes #13
Diffstat (limited to 'module/plugins/container')
-rw-r--r-- | module/plugins/container/CCF.py | 55 | ||||
-rw-r--r-- | module/plugins/container/DLC.pyc | bin | 0 -> 5740 bytes | |||
-rw-r--r-- | module/plugins/container/LinkList.py | 39 | ||||
-rw-r--r-- | module/plugins/container/RSDF.py | 50 | ||||
-rw-r--r-- | module/plugins/container/__init__.py | 0 |
5 files changed, 144 insertions, 0 deletions
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py new file mode 100644 index 000000000..88b567904 --- /dev/null +++ b/module/plugins/container/CCF.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os.path +import random +import re +import tempfile +import urllib2 + +from module.Plugin import Plugin +from module.network.MultipartPostHandler import MultipartPostHandler + +class CCF(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "CCF" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.ccf" + props['version'] = "0.1" + props['description'] = """CCF Container Convert Plugin""" + props['author_name'] = ("Willnix") + props['author_mail'] = ("Willnix@pyload.org") + self.props = props + self.parent = parent + self.multi_dl = True + self.links = [] + + def proceed(self, url, location): + infile = url.replace("\n", "") + + opener = urllib2.build_opener(MultipartPostHandler) + params = {"src": "ccf", + "filename": "test.ccf", + "upload": open(infile, "rb")} + tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read() + + random.seed() + tempdir = tempfile.gettempdir() + if tempdir[0] == '/': + delim = '/' + else: + delim = '\\' + tempdlc_name = tempdir + delim + str(random.randint(0, 100)) + '-tmp.dlc' + while os.path.exists(tempdlc_name): + tempdlc_name = tempfile.gettempdir() + '/' + str(random.randint(0, 100)) + '-tmp.dlc' + + tempdlc = open(tempdlc_name, "w") + tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.DOTALL).group(1)) + tempdlc.close + + self.links.append(tempdlc_name) + + return True diff --git a/module/plugins/container/DLC.pyc b/module/plugins/container/DLC.pyc Binary files differnew file mode 100644 index 000000000..235e46e1a --- /dev/null +++ b/module/plugins/container/DLC.pyc diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py new file mode 100644 index 000000000..92508ce29 --- /dev/null +++ b/module/plugins/container/LinkList.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + + +from module.Plugin import Plugin + +class LinkList(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "LinkList" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.txt" + props['version'] = "0.1" + props['description'] = """Read Link Lists in txt format""" + props['author_name'] = ("Spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def proceed(self, linkList, location): + tmpLinks = [] + txt = open(linkList, 'r') + links = txt.readlines() + for link in links: + if link != "\n": + tmpLinks.append(link.replace("\n", "")) + txt.close() + + if not self.parent.core.config['general']['debug_mode']: + txt = open(linkList, 'w') + txt.write("") + txt.close() + #@TODO: maybe delete read txt file? + + self.links = tmpLinks diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py new file mode 100644 index 000000000..0b6a63722 --- /dev/null +++ b/module/plugins/container/RSDF.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import base64 +import binascii + +from module.Plugin import Plugin + +class RSDF(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RSDF" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.rsdf" + props['version'] = "0.2" + props['description'] = """RSDF Container Decode Plugin""" + props['author_name'] = ("RaNaN", "spoob") + props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") + self.props = props + self.parent = parent + self.multi_dl = True + self.links = [] + + def proceed(self, url, location): + from Crypto.Cipher import AES + + infile = url.replace("\n", "") + Key = binascii.unhexlify('8C35192D964DC3182C6F84F3252239EB4A320D2500000000') + + IV = binascii.unhexlify('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') + IV_Cipher = AES.new(Key, AES.MODE_ECB) + IV = IV_Cipher.encrypt(IV) + + obj = AES.new(Key, AES.MODE_CFB, IV) + + rsdf = open(infile, 'r') + + data = rsdf.read() + data = binascii.unhexlify(''.join(data.split())) + data = data.splitlines() + + for link in data: + link = base64.b64decode(link) + link = obj.decrypt(link) + decryptedUrl = link.replace('CCF: ', '') + self.links.append(decryptedUrl) + + rsdf.close() diff --git a/module/plugins/container/__init__.py b/module/plugins/container/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/module/plugins/container/__init__.py |