diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-13 15:56:57 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-13 15:56:57 +0100 |
commit | acc46fc3497a66a427b795b4a22c6e71d69185a1 (patch) | |
tree | 2d315b838a76435fc456b972c99c28d1732b2f70 /pyload/plugins/container | |
parent | Code fixes (diff) | |
download | pyload-acc46fc3497a66a427b795b4a22c6e71d69185a1.tar.xz |
Update
Diffstat (limited to 'pyload/plugins/container')
-rw-r--r-- | pyload/plugins/container/CCF.py | 43 | ||||
-rw-r--r-- | pyload/plugins/container/LinkList.py | 71 | ||||
-rw-r--r-- | pyload/plugins/container/RSDF.py | 56 | ||||
-rw-r--r-- | pyload/plugins/container/__init__.py | 1 |
4 files changed, 0 insertions, 171 deletions
diff --git a/pyload/plugins/container/CCF.py b/pyload/plugins/container/CCF.py deleted file mode 100644 index 9488d75f9..000000000 --- a/pyload/plugins/container/CCF.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import re - -from os import makedirs -from os.path import exists -from urllib2 import build_opener - -from MultipartPostHandler import MultipartPostHandler - -from pyload.plugins.Container import Container -from pyload.utils import safe_join - - -class CCF(Container): - __name = "CCF" - __version = "0.20" - - __pattern = r'.+\.ccf' - - __description = """CCF container decrypter plugin""" - __license = "GPLv3" - __authors = [("Willnix", "Willnix@pyload.org")] - - - def decrypt(self, pyfile): - infile = pyfile.url.replace("\n", "") - - opener = 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'] - - tempdlc_name = safe_join(download_folder, "tmp_%s.dlc" % pyfile.name) - with open(tempdlc_name, "w") as tempdlc: - tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.S).group(1)) - - self.urls = [tempdlc_name] diff --git a/pyload/plugins/container/LinkList.py b/pyload/plugins/container/LinkList.py deleted file mode 100644 index f80eecd4d..000000000 --- a/pyload/plugins/container/LinkList.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- - -import codecs - -from pyload.plugins.Container import Container -from pyload.utils import fs_encode - - -class LinkList(Container): - __name = "LinkList" - __version = "0.12" - - __pattern = r'.+\.txt' - __config = [("clear", "bool", "Clear Linklist after adding", False), - ("encoding", "string", "File encoding (default 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: - file_enc = codecs.lookup(self.getConfig("encoding")).name - except Exception: - file_enc = "utf-8" - - file_name = fs_encode(pyfile.url) - - txt = codecs.open(file_name, 'r', file_enc) - links = txt.readlines() - curPack = "Parsed links from %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) - 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 self.getConfig("clear"): - try: - txt = open(file_name, 'wb') - txt.close() - except Exception: - self.logWarning(_("LinkList could not be cleared")) - - for name, links in packages.iteritems(): - self.packages.append((name, links, name)) diff --git a/pyload/plugins/container/RSDF.py b/pyload/plugins/container/RSDF.py deleted file mode 100644 index 001b64bbc..000000000 --- a/pyload/plugins/container/RSDF.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import base64 -import binascii -import re - -from pyload.plugins.Container import Container -from pyload.utils import fs_encode - - -class RSDF(Container): - __name = "RSDF" - __version = "0.24" - - __pattern = r'.+\.rsdf' - - __description = """RSDF container decrypter plugin""" - __license = "GPLv3" - __authors = [("RaNaN", "RaNaN@pyload.org"), - ("spoob", "spoob@pyload.org")] - - - def decrypt(self, pyfile): - - from Crypto.Cipher import AES - - infile = fs_encode(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) - - try: - with open(infile, 'r') as rsdf: - data = rsdf.read() - except IOError, e: - self.fail(str(e)) - - if re.search(r"<title>404 - Not Found</title>", data) is None: - data = binascii.unhexlify(''.join(data.split())) - data = data.splitlines() - - for link in data: - if not link: - continue - link = base64.b64decode(link) - link = obj.decrypt(link) - decryptedUrl = link.replace('CCF: ', '') - self.urls.append(decryptedUrl) - - self.logDebug("Adding package %s with %d links" % (pyfile.package().name, len(self.urls))) diff --git a/pyload/plugins/container/__init__.py b/pyload/plugins/container/__init__.py deleted file mode 100644 index 40a96afc6..000000000 --- a/pyload/plugins/container/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- |