summaryrefslogtreecommitdiffstats
path: root/module/plugins/container/DLC.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-02-03 16:09:13 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-02-03 16:09:13 +0100
commit193cb8dbe1b24c24fb919461f16b2215e85da739 (patch)
tree5e3649a750666a8312b9f1de43d5b9e2f98da3b6 /module/plugins/container/DLC.py
parent[ClickAndLoad] Fix https://github.com/pyload/pyload/issues/1135 (diff)
downloadpyload-193cb8dbe1b24c24fb919461f16b2215e85da739.tar.xz
Update container plugins
Diffstat (limited to 'module/plugins/container/DLC.py')
-rw-r--r--module/plugins/container/DLC.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/module/plugins/container/DLC.py b/module/plugins/container/DLC.py
index 589beab4e..b01e3098c 100644
--- a/module/plugins/container/DLC.py
+++ b/module/plugins/container/DLC.py
@@ -14,7 +14,7 @@ from module.utils import decode, fs_encode
class DLC(Container):
__name__ = "DLC"
__type__ = "container"
- __version__ = "0.23"
+ __version__ = "0.24"
__pattern__ = r'.+\.dlc$'
@@ -39,18 +39,19 @@ class DLC(Container):
data += '=' * (-len(data) % 4)
- dlckey = data[-88:]
- dlcdata = data[:-88].decode('base64')
+ dlc_key = data[-88:]
+ dlc_data = data[:-88].decode('base64')
+ dlc_content = self.load(self.API_URL % dlc_key)
try:
- rc = re.search(r'<rc>(.+)</rc>', self.load(self.API_URL % dlckey)).group(1).decode('base64')
+ rc = re.search(r'<rc>(.+)</rc>', dlc_content, re.S).group(1).decode('base64')
- except Exception:
- self.fail(_("DLC file is corrupted"))
+ except AttributeError:
+ self.fail(_("Container is corrupted"))
- dlckey = AES.new(self.KEY, AES.MODE_CBC, self.IV).decrypt(rc)
+ cipher = AES.new(self.KEY, AES.MODE_CBC, self.IV).decrypt(rc)
- self.data = AES.new(dlckey, AES.MODE_CBC, dlckey).decrypt(dlcdata).decode('base64')
+ self.data = AES.new(cipher, AES.MODE_CBC, cipher).decrypt(dlc_data).decode('base64')
self.packages = [(entry[0] if entry[0] else pyfile.name, entry[1], entry[0] if entry[0] else pyfile.name) \
for entry in self.getPackages()]