diff options
author | Jeix <devnull@localhost> | 2010-08-03 12:30:52 +0200 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-08-03 12:30:52 +0200 |
commit | b97c7b1d4a6ca288cb945aa823e67685e6da234f (patch) | |
tree | 7ed065805b3fbc1a5669f782fe42cbbcf6ab0b5b /module/plugins/container/CCF.py | |
parent | new dlc plugins (diff) | |
download | pyload-b97c7b1d4a6ca288cb945aa823e67685e6da234f.tar.xz |
Container updated to new interface
Diffstat (limited to 'module/plugins/container/CCF.py')
-rw-r--r-- | module/plugins/container/CCF.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py index 1e25ef623..87aeccebe 100644 --- a/module/plugins/container/CCF.py +++ b/module/plugins/container/CCF.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- import re -import tempfile import urllib2 from module.plugins.Container import Container @@ -10,20 +9,16 @@ from module.network.MultipartPostHandler import MultipartPostHandler class CCF(Container): __name__ = "CCF" - __version__ = "0.1" + __version__ = "0.2" __pattern__ = r"(?!http://).*\.ccf" __description__ = """CCF Container Convert Plugin""" __author_name__ = ("Willnix") __author_mail__ = ("Willnix@pyload.org") - def __init__(self, parent): - Container.__init__(self, parent) - self.parent = parent - self.multi_dl = True - self.links = [] - - def proceed(self, url, location): - infile = url.replace("\n", "") + def decrypt(self, pyfile): + self.loadToDisk() + + infile = pyfile.url.replace("\n", "") opener = urllib2.build_opener(MultipartPostHandler) params = {"src": "ccf", @@ -31,11 +26,15 @@ class CCF(Container): "upload": open(infile, "rb")} tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read() - tempdlc = tempfile.NamedTemporaryFile(delete=False, suffix='.dlc') + 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 = "tmp_%s.dlc" % join(location, pyfile.name) + 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 + self.packages.append((tempdlc_name, [tempdlc_name], tempdlc_name)) |