summaryrefslogtreecommitdiffstats
path: root/module/plugins/container
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-25 18:22:27 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-25 18:22:27 +0200
commit29f9dc8fb3396b03d732ebcbeb1cc8f00fe13897 (patch)
treef2a910cbea747a7b0c0a50d6c66691e54f5ef47f /module/plugins/container
parentmerged gui (diff)
downloadpyload-29f9dc8fb3396b03d732ebcbeb1cc8f00fe13897.tar.xz
new dirs
Diffstat (limited to 'module/plugins/container')
-rw-r--r--module/plugins/container/CCF.py42
-rw-r--r--module/plugins/container/DLC_25.pycbin0 -> 8211 bytes
-rw-r--r--module/plugins/container/DLC_26.pycbin0 -> 8184 bytes
-rw-r--r--module/plugins/container/LinkList.py56
-rw-r--r--module/plugins/container/RSDF.py46
-rw-r--r--module/plugins/container/__init__.py0
6 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..8b35589f3
--- /dev/null
+++ b/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/module/plugins/container/DLC_25.pyc b/module/plugins/container/DLC_25.pyc
new file mode 100644
index 000000000..92c9e41ef
--- /dev/null
+++ b/module/plugins/container/DLC_25.pyc
Binary files differ
diff --git a/module/plugins/container/DLC_26.pyc b/module/plugins/container/DLC_26.pyc
new file mode 100644
index 000000000..1d38fa1d9
--- /dev/null
+++ b/module/plugins/container/DLC_26.pyc
Binary files differ
diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py
new file mode 100644
index 000000000..c9e7a85a3
--- /dev/null
+++ b/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/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py
new file mode 100644
index 000000000..de2ff9048
--- /dev/null
+++ b/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/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