diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-29 15:56:57 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-29 15:56:57 +0100 |
commit | cb9e67a5437ddfafd6a93f5a208b9faf3f2d5575 (patch) | |
tree | 2175310fe13226ac859dac57d5e3a1d14d9223bf /module/plugins/container/CCF.py | |
parent | [ExtractArchive] Fix typo (thx SelmaUrban) (diff) | |
download | pyload-cb9e67a5437ddfafd6a93f5a208b9faf3f2d5575.tar.xz |
Some file encoding fixup + optimizations
Diffstat (limited to 'module/plugins/container/CCF.py')
-rw-r--r-- | module/plugins/container/CCF.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py index c6e642cca..e7ad8f761 100644 --- a/module/plugins/container/CCF.py +++ b/module/plugins/container/CCF.py @@ -11,12 +11,13 @@ from urllib2 import build_opener from MultipartPostHandler import MultipartPostHandler from module.plugins.Container import Container -from module.utils import save_join +from module.utils import fs_encode, save_join class CCF(Container): __name__ = "CCF" - __version__ = "0.21" + __type__ = "container" + __version__ = "0.22" __pattern__ = r'.+\.ccf$' @@ -26,17 +27,17 @@ class CCF(Container): def decrypt(self, pyfile): - infile = pyfile.url.replace("\n", "") - + file = fs_encode(pyfile.url.strip()) 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() + + tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', + {'src' : "ccf", + 'filename': "test.ccf", + 'upload' : open(file, "rb")}).read() download_folder = self.config['general']['download_folder'] + tempdlc_name = save_join(download_folder, "tmp_%s.dlc" % pyfile.name) - tempdlc_name = save_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)) |