MCPcopy
hub / github.com/pyload/pyload / decrypt

Method decrypt

module/plugins/container/CCF.py:30–51  ·  view source on GitHub ↗
(self, pyfile)

Source from the content-addressed store, hash-verified

28 ("Walter Purcaro", "vuolter@gmail.com")]
29
30 def decrypt(self, pyfile):
31 fs_filename = fs_encode(pyfile.url)
32 opener = urllib2.build_opener(MultipartPostHandler.MultipartPostHandler)
33
34 dlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php',
35 {'src': "ccf",
36 'filename': "test.ccf",
37 'upload': open(fs_filename, "rb")}).read()
38
39 dl_folder = self.pyload.config.get('general', 'download_folder')
40 dlc_file = fsjoin(dl_folder, "tmp_%s.dlc" % pyfile.name)
41
42 try:
43 dlc = re.search(r'<dlc>(.+)</dlc>', dlc_content, re.S).group(1).decode('base64')
44
45 except AttributeError:
46 self.fail(_("Container is corrupted"))
47
48 with open(dlc_file, "w") as tempdlc:
49 tempdlc.write(dlc)
50
51 self.links = [dlc_file]

Callers

nothing calls this directly

Calls 10

fsjoinFunction · 0.85
decodeMethod · 0.80
fs_encodeFunction · 0.50
_Function · 0.50
readMethod · 0.45
openMethod · 0.45
getMethod · 0.45
searchMethod · 0.45
failMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected