diff options
author | mkaay <mkaay@mkaay.de> | 2010-08-25 16:48:55 +0200 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-08-25 16:48:55 +0200 |
commit | 3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea (patch) | |
tree | c5b2b1bfeb7eb8df2b97be118f6cbcec4e29cb3b /core/module/plugins/container | |
parent | ul.to fetching, so.biz expire (diff) | |
download | pyload-3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea.tar.xz |
merged gui
Diffstat (limited to 'core/module/plugins/container')
-rw-r--r-- | core/module/plugins/container/CCF.py | 42 | ||||
-rw-r--r-- | core/module/plugins/container/DLC_25.pyc | bin | 0 -> 8211 bytes | |||
-rw-r--r-- | core/module/plugins/container/DLC_26.pyc | bin | 0 -> 8184 bytes | |||
-rw-r--r-- | core/module/plugins/container/LinkList.py | 56 | ||||
-rw-r--r-- | core/module/plugins/container/RSDF.py | 46 | ||||
-rw-r--r-- | core/module/plugins/container/__init__.py | 0 |
6 files changed, 144 insertions, 0 deletions
diff --git a/core/module/plugins/container/CCF.py b/core/module/plugins/container/CCF.py new file mode 100644 index 000000000..8b35589f3 --- /dev/null +++ b/core/module/plugins/container/CCF.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib2 + +from module.plugins.Container import Container +from module.network.MultipartPostHandler import MultipartPostHandler + +from os import makedirs +from os.path import exists, join + +class CCF(Container): + __name__ = "CCF" + __version__ = "0.2" + __pattern__ = r"(?!http://).*\.ccf" + __description__ = """CCF Container Convert Plugin""" + __author_name__ = ("Willnix") + __author_mail__ = ("Willnix@pyload.org") + + def decrypt(self, pyfile): + + infile = pyfile.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() + + download_folder = self.config['general']['download_folder'] + location = download_folder #join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding())) + if not exists(location): + makedirs(location) + + tempdlc_name = join(location, "tmp_%s.dlc" % pyfile.name) + tempdlc = open(tempdlc_name, "w") + tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.DOTALL).group(1)) + tempdlc.close() + + self.packages.append((tempdlc_name, [tempdlc_name], tempdlc_name)) + diff --git a/core/module/plugins/container/DLC_25.pyc b/core/module/plugins/container/DLC_25.pyc Binary files differnew file mode 100644 index 000000000..92c9e41ef --- /dev/null +++ b/core/module/plugins/container/DLC_25.pyc diff --git a/core/module/plugins/container/DLC_26.pyc b/core/module/plugins/container/DLC_26.pyc Binary files differnew file mode 100644 index 000000000..1d38fa1d9 --- /dev/null +++ b/core/module/plugins/container/DLC_26.pyc diff --git a/core/module/plugins/container/LinkList.py b/core/module/plugins/container/LinkList.py new file mode 100644 index 000000000..c9e7a85a3 --- /dev/null +++ b/core/module/plugins/container/LinkList.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + + +from module.plugins.Container import Container + +class LinkList(Container): + __name__ = "LinkList" + __version__ = "0.1" + __pattern__ = r".*\.txt$" + __description__ = """Read Link Lists in txt format""" + __author_name__ = ("spoob", "jeix") + __author_mail__ = ("spoob@pyload.org", "jeix@hasnomail.com") + + + def decrypt(self, pyfile): + + txt = open(pyfile.url, 'r') + links = txt.readlines() + curPack = "Parsed links %s" % pyfile.name + + packages = {curPack:[],} + + for link in links: + 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.replace("\n", "")) + txt.close() + + # empty packages fix + + delete = [] + + for key,value in packages.iteritems(): + if not value: + delete.append(key) + + for key in delete: + del packages[key] + + if not self.core.debug: + txt = open(linkList, 'w') + txt.write("") + txt.close() + #@TODO: maybe delete read txt file? + + for name, links in packages.iteritems(): + self.packages.append((name, links, name)) diff --git a/core/module/plugins/container/RSDF.py b/core/module/plugins/container/RSDF.py new file mode 100644 index 000000000..de2ff9048 --- /dev/null +++ b/core/module/plugins/container/RSDF.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import base64 +import binascii + +from module.plugins.Container import Container + +class RSDF(Container): + __name__ = "RSDF" + __version__ = "0.2" + __pattern__ = r"(?!http://).*\.rsdf" + __description__ = """RSDF Container Decode Plugin""" + __author_name__ = ("RaNaN", "spoob") + __author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org") + + + def decrypt(self, pyfile): + + from Crypto.Cipher import AES + + infile = pyfile.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() + + links = [] + for link in data: + link = base64.b64decode(link) + link = obj.decrypt(link) + decryptedUrl = link.replace('CCF: ', '') + links.append(decryptedUrl) + + rsdf.close() + + self.packages.append((pyfile.name, links, pyfile.name)) diff --git a/core/module/plugins/container/__init__.py b/core/module/plugins/container/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/core/module/plugins/container/__init__.py |