diff options
Diffstat (limited to 'module/plugins/hoster/MegaCoNz.py')
-rw-r--r-- | module/plugins/hoster/MegaCoNz.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 52851d80a..054116404 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -1,19 +1,17 @@ # -*- coding: utf-8 -*- import array +import base64 import os import random import re +import Crypto.Cipher +import Crypto.Util # import pycurl -from base64 import standard_b64decode - -from Crypto.Cipher import AES -from Crypto.Util import Counter - from module.plugins.internal.Hoster import Hoster -from module.plugins.internal.utils import decode, encode, json +from module.plugins.internal.misc import decode, encode, json ############################ General errors ################################### @@ -48,7 +46,7 @@ from module.plugins.internal.utils import decode, encode, json class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" - __version__ = "0.33" + __version__ = "0.34" __status__ = "testing" __pattern__ = r'(https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?P<TYPE>N|)!(?P<ID>[\w^_]+)!(?P<KEY>[\w\-,]+)' @@ -96,7 +94,7 @@ class MegaCoNz(Hoster): def decrypt_attr(self, data, key): k, iv, meta_mac = self.get_cipher_key(key) - cbc = AES.new(k, AES.MODE_CBC, "\0" * 16) + cbc = Crypto.Cipher.AES.new(k, Crypto.Cipher.AES.MODE_CBC, "\0" * 16) attr = decode(cbc.decrypt(self.b64_decode(data))) self.log_debug("Decrypted Attr: %s" % attr) @@ -116,8 +114,8 @@ class MegaCoNz(Hoster): #: Convert counter to long and shift bytes k, iv, meta_mac = self.get_cipher_key(key) - ctr = Counter.new(128, initial_value=long(n.encode("hex"), 16) << 64) - cipher = AES.new(k, AES.MODE_CTR, counter=ctr) + ctr = Crypto.Util.Counter.new(128, initial_value=long(n.encode("hex"), 16) << 64) + cipher = Crypto.Cipher.AES.new(k, Crypto.Cipher.AES.MODE_CTR, counter=ctr) self.pyfile.setStatus("decrypting") self.pyfile.setProgress(0) |