summaryrefslogtreecommitdiffstats
path: root/module/plugins/container/DLC.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/container/DLC.py')
-rw-r--r--module/plugins/container/DLC.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/module/plugins/container/DLC.py b/module/plugins/container/DLC.py
index 7b4364a0a..91e421590 100644
--- a/module/plugins/container/DLC.py
+++ b/module/plugins/container/DLC.py
@@ -5,22 +5,22 @@ from __future__ import with_statement
import re
import xml.dom.minidom
-from Crypto.Cipher import AES
+import Crypto.Cipher
from module.plugins.internal.Container import Container
-from module.plugins.internal.utils import decode, encode
+from module.plugins.internal.misc import decode, encode
class DLC(Container):
__name__ = "DLC"
__type__ = "container"
- __version__ = "0.28"
+ __version__ = "0.29"
__status__ = "testing"
__pattern__ = r'(.+\.dlc|[\w\+^_]+==[\w\+^_/]+==)$'
- __config__ = [("activated" , "bool", "Activated" , True),
- ("use_subfolder" , "bool", "Save package to subfolder" , True),
- ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
+ __config__ = [("activated" , "bool" , "Activated" , True ),
+ ("use_premium" , "bool" , "Use premium account if available", True ),
+ ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default")]
__description__ = """DLC container decrypter plugin"""
__license__ = "GPLv3"
@@ -37,7 +37,7 @@ class DLC(Container):
def decrypt(self, pyfile):
- fs_filename = encode(pyfile.url.strip())
+ fs_filename = encode(pyfile.url)
with open(fs_filename) as dlc:
data = dlc.read().strip()
@@ -53,9 +53,9 @@ class DLC(Container):
except AttributeError:
self.fail(_("Container is corrupted"))
- key = iv = AES.new(self.KEY, AES.MODE_CBC, self.IV).decrypt(rc)
+ key = iv = Crypto.Cipher.AES.new(self.KEY, Crypto.Cipher.AES.MODE_CBC, self.IV).decrypt(rc)
- self.data = AES.new(key, AES.MODE_CBC, iv).decrypt(dlc_data).decode('base64')
+ self.data = Crypto.Cipher.AES.new(key, Crypto.Cipher.AES.MODE_CBC, iv).decrypt(dlc_data).decode('base64')
self.packages = [(name or pyfile.name, links, name or pyfile.name) \
for name, links in self.get_packages()]