From 670d3bffb19c3e1cc4be06a81165e055edeb1692 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 30 May 2015 21:16:41 +0200 Subject: [MegaCoNz] Update __pattern__ --- module/plugins/hoster/MegaCoNz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index aa7755af4..811caed24 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -48,9 +48,9 @@ from module.utils import decode, fs_decode, fs_encode class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" - __version__ = "0.26" + __version__ = "0.27" - __pattern__ = r'(?:https?://(?:www\.)?mega\.co\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' + __pattern__ = r'(?:https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' __description__ = """Mega.co.nz hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 37ece937eddca46080094ffcfefd1f333078c4d2 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Mon, 1 Jun 2015 04:56:58 +0300 Subject: Update MegaCoNz.py --- module/plugins/hoster/MegaCoNz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 811caed24..e1a350802 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -48,7 +48,7 @@ from module.utils import decode, fs_decode, fs_encode class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" - __version__ = "0.27" + __version__ = "0.28" __pattern__ = r'(?:https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' @@ -82,7 +82,7 @@ class MegaCoNz(Hoster): """ Dispatch a call to the api, see https://mega.co.nz/#developers """ # generate a session id, no idea where to obtain elsewhere - uid = random.random.randint(10 << 9, 10 ** 10) + uid = random.randint(10 << 9, 10 ** 10) res = self.load(self.API_URL, get={'id': uid}, post=json_dumps([kwargs])) self.logDebug("Api Response: " + res) -- cgit v1.2.3 From c7a88375b94652a92a7d161dab059ff9a4c879e1 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Tue, 2 Jun 2015 08:19:31 +0300 Subject: [MegaCoNz] small typo --- module/plugins/hoster/MegaCoNz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index e1a350802..5280b42ec 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -48,9 +48,9 @@ from module.utils import decode, fs_decode, fs_encode class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" - __version__ = "0.28" + __version__ = "0.29" - __pattern__ = r'(?:https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' + __pattern__ = r'(?:https?://(?:www\.)?mega(?:\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' __description__ = """Mega.co.nz hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 6283481a29e49776703ce6688b3e4fcb5dd11bf2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 04:02:12 +0200 Subject: [FreeWayMe] Fixup --- module/plugins/hoster/MegaCoNz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 5280b42ec..5e850a3fe 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -50,7 +50,7 @@ class MegaCoNz(Hoster): __type__ = "hoster" __version__ = "0.29" - __pattern__ = r'(?:https?://(?:www\.)?mega(?:\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' + __pattern__ = r'(https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' __description__ = """Mega.co.nz hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/hoster/MegaCoNz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 5e850a3fe..08eab2fb1 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -12,7 +12,7 @@ from Crypto.Cipher import AES from Crypto.Util import Counter from module.common.json_layer import json_loads, json_dumps -from module.plugins.Hoster import Hoster +from module.plugins.internal.Hoster import Hoster from module.utils import decode, fs_decode, fs_encode @@ -48,7 +48,7 @@ from module.utils import decode, fs_decode, fs_encode class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" - __version__ = "0.29" + __version__ = "0.30" __pattern__ = r'(https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' -- cgit v1.2.3 From 164512b6a74c94a731fcee7435dce1ccfa2f71e7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:29:50 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/MegaCoNz.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 08eab2fb1..20b879aba 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -68,7 +68,9 @@ class MegaCoNz(Hoster): def getCipherKey(self, key): - """ Construct the cipher key from the given data """ + """ + Construct the cipher key from the given data + """ a = array.array("I", self.b64_decode(key)) k = array.array("I", (a[0] ^ a[4], a[1] ^ a[5], a[2] ^ a[6], a[3] ^ a[7])) @@ -79,8 +81,9 @@ class MegaCoNz(Hoster): def api_response(self, **kwargs): - """ Dispatch a call to the api, see https://mega.co.nz/#developers """ - + """ + Dispatch a call to the api, see https://mega.co.nz/#developers + """ # generate a session id, no idea where to obtain elsewhere uid = random.randint(10 << 9, 10 ** 10) @@ -103,8 +106,9 @@ class MegaCoNz(Hoster): def decryptFile(self, key): - """ Decrypts the file at lastDownload` """ - + """ + Decrypts the file at lastDownload` + """ # upper 64 bit of counter start n = self.b64_decode(key)[16:24] -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/hoster/MegaCoNz.py | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 20b879aba..2e6dcfda6 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -84,7 +84,7 @@ class MegaCoNz(Hoster): """ Dispatch a call to the api, see https://mega.co.nz/#developers """ - # generate a session id, no idea where to obtain elsewhere + #: generate a session id, no idea where to obtain elsewhere uid = random.randint(10 << 9, 10 ** 10) res = self.load(self.API_URL, get={'id': uid}, post=json_dumps([kwargs])) @@ -101,7 +101,7 @@ class MegaCoNz(Hoster): if not attr.startswith("MEGA"): self.fail(_("Decryption failed")) - # Data is padded, 0-bytes must be stripped + #: Data is padded, 0-bytes must be stripped return json_loads(re.search(r'{.+?}', attr).group(0)) @@ -109,10 +109,10 @@ class MegaCoNz(Hoster): """ Decrypts the file at lastDownload` """ - # upper 64 bit of counter start + #: upper 64 bit of counter start n = self.b64_decode(key)[16:24] - # convert counter to long and shift bytes + #: convert counter to long and shift bytes k, iv, meta_mac = self.getCipherKey(key) ctr = Counter.new(128, initial_value=long(n.encode("hex"), 16) << 64) cipher = AES.new(k, AES.MODE_CTR, counter=ctr) @@ -130,8 +130,8 @@ class MegaCoNz(Hoster): except IOError, e: self.fail(e) - chunk_size = 2 ** 15 # buffer size, 32k - # file_mac = [0, 0, 0, 0] # calculate CBC-MAC for checksum + chunk_size = 2 ** 15 #: buffer size, 32k + #: file_mac = [0, 0, 0, 0] # calculate CBC-MAC for checksum chunks = os.path.getsize(file_crypted) / chunk_size + 1 for i in xrange(chunks): @@ -144,27 +144,27 @@ class MegaCoNz(Hoster): self.pyfile.setProgress(int((100.0 / chunks) * i)) - # chunk_mac = [iv[0], iv[1], iv[0], iv[1]] - # for i in xrange(0, chunk_size, 16): - # block = chunk[i:i+16] - # if len(block) % 16: - # block += '=' * (16 - (len(block) % 16)) - # block = array.array("I", block) + #: chunk_mac = [iv[0], iv[1], iv[0], iv[1]] + #: for i in xrange(0, chunk_size, 16): + #: block = chunk[i:i+16] + #: if len(block) % 16: + #: block += '=' * (16 - (len(block) % 16)) + #: block = array.array("I", block) - # chunk_mac = [chunk_mac[0] ^ a_[0], chunk_mac[1] ^ block[1], chunk_mac[2] ^ block[2], chunk_mac[3] ^ block[3]] - # chunk_mac = aes_cbc_encrypt_a32(chunk_mac, k) + #: chunk_mac = [chunk_mac[0] ^ a_[0], chunk_mac[1] ^ block[1], chunk_mac[2] ^ block[2], chunk_mac[3] ^ block[3]] + #: chunk_mac = aes_cbc_encrypt_a32(chunk_mac, k) - # file_mac = [file_mac[0] ^ chunk_mac[0], file_mac[1] ^ chunk_mac[1], file_mac[2] ^ chunk_mac[2], file_mac[3] ^ chunk_mac[3]] - # file_mac = aes_cbc_encrypt_a32(file_mac, k) + #: file_mac = [file_mac[0] ^ chunk_mac[0], file_mac[1] ^ chunk_mac[1], file_mac[2] ^ chunk_mac[2], file_mac[3] ^ chunk_mac[3]] + #: file_mac = aes_cbc_encrypt_a32(file_mac, k) self.pyfile.setProgress(100) f.close() df.close() - # if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] != meta_mac: - # os.remove(file_decrypted) - # self.fail(_("Checksum mismatch")) + #: if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] != meta_mac: + #: os.remove(file_decrypted) + #: self.fail(_("Checksum mismatch")) os.remove(file_crypted) self.lastDownload = fs_decode(file_decrypted) @@ -194,8 +194,8 @@ class MegaCoNz(Hoster): self.logDebug("ID: %s" % id, "Key: %s" % key, "Type: %s" % ("public" if public else "node")) - # g is for requesting a download url - # this is similar to the calls in the mega js app, documentation is very bad + #: g is for requesting a download url + #: this is similar to the calls in the mega js app, documentation is very bad if public: mega = self.api_response(a="g", g=1, p=id, ssl=1)[0] else: @@ -211,11 +211,11 @@ class MegaCoNz(Hoster): pyfile.name = attr['n'] + self.FILE_SUFFIX pyfile.size = mega['s'] - # self.req.http.c.setopt(pycurl.SSL_CIPHER_LIST, "RC4-MD5:DEFAULT") + #: self.req.http.c.setopt(pycurl.SSL_CIPHER_LIST, "RC4-MD5:DEFAULT") self.download(mega['g']) self.decryptFile(key) - # Everything is finished and final name can be set + #: Everything is finished and final name can be set pyfile.name = attr['n'] -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hoster/MegaCoNz.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 2e6dcfda6..411c12c4a 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -48,7 +48,7 @@ from module.utils import decode, fs_decode, fs_encode class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" - __version__ = "0.30" + __version__ = "0.31" __pattern__ = r'(https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' @@ -67,7 +67,7 @@ class MegaCoNz(Hoster): return standard_b64decode(data + '=' * (-len(data) % 4)) - def getCipherKey(self, key): + def get_cipher_key(self, key): """ Construct the cipher key from the given data """ @@ -88,16 +88,16 @@ class MegaCoNz(Hoster): uid = random.randint(10 << 9, 10 ** 10) res = self.load(self.API_URL, get={'id': uid}, post=json_dumps([kwargs])) - self.logDebug("Api Response: " + res) + self.log_debug("Api Response: " + res) return json_loads(res) - def decryptAttr(self, data, key): - k, iv, meta_mac = self.getCipherKey(key) + def decrypt_attr(self, data, key): + k, iv, meta_mac = self.get_cipher_key(key) cbc = AES.new(k, AES.MODE_CBC, "\0" * 16) attr = decode(cbc.decrypt(self.b64_decode(data))) - self.logDebug("Decrypted Attr: %s" % attr) + self.log_debug("Decrypted Attr: %s" % attr) if not attr.startswith("MEGA"): self.fail(_("Decryption failed")) @@ -105,7 +105,7 @@ class MegaCoNz(Hoster): return json_loads(re.search(r'{.+?}', attr).group(0)) - def decryptFile(self, key): + def decrypt_file(self, key): """ Decrypts the file at lastDownload` """ @@ -113,14 +113,14 @@ class MegaCoNz(Hoster): n = self.b64_decode(key)[16:24] #: convert counter to long and shift bytes - k, iv, meta_mac = self.getCipherKey(key) + 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) self.pyfile.setStatus("decrypting") self.pyfile.setProgress(0) - file_crypted = fs_encode(self.lastDownload) + file_crypted = fs_encode(self.last_download) file_decrypted = file_crypted.rsplit(self.FILE_SUFFIX)[0] try: @@ -167,17 +167,17 @@ class MegaCoNz(Hoster): #: self.fail(_("Checksum mismatch")) os.remove(file_crypted) - self.lastDownload = fs_decode(file_decrypted) + self.last_download = fs_decode(file_decrypted) - def checkError(self, code): + def check_error(self, code): ecode = abs(code) if ecode in (9, 16, 21): self.offline() elif ecode in (3, 13, 17, 18, 19): - self.tempOffline() + self.temp_offline() elif ecode in (1, 4, 6, 10, 15, 21): self.retry(5, 30, _("Error code: [%s]") % -ecode) @@ -192,7 +192,7 @@ class MegaCoNz(Hoster): key = pattern['KEY'] public = pattern['TYPE'] == '' - self.logDebug("ID: %s" % id, "Key: %s" % key, "Type: %s" % ("public" if public else "node")) + self.log_debug("ID: %s" % id, "Key: %s" % key, "Type: %s" % ("public" if public else "node")) #: g is for requesting a download url #: this is similar to the calls in the mega js app, documentation is very bad @@ -202,11 +202,11 @@ class MegaCoNz(Hoster): mega = self.api_response(a="g", g=1, n=id, ssl=1)[0] if isinstance(mega, int): - self.checkError(mega) + self.check_error(mega) elif "e" in mega: - self.checkError(mega['e']) + self.check_error(mega['e']) - attr = self.decryptAttr(mega['at'], key) + attr = self.decrypt_attr(mega['at'], key) pyfile.name = attr['n'] + self.FILE_SUFFIX pyfile.size = mega['s'] @@ -215,7 +215,7 @@ class MegaCoNz(Hoster): self.download(mega['g']) - self.decryptFile(key) + self.decrypt_file(key) #: Everything is finished and final name can be set pyfile.name = attr['n'] -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/hoster/MegaCoNz.py | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 411c12c4a..9a2726448 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -84,7 +84,7 @@ class MegaCoNz(Hoster): """ Dispatch a call to the api, see https://mega.co.nz/#developers """ - #: generate a session id, no idea where to obtain elsewhere + #: Generate a session id, no idea where to obtain elsewhere uid = random.randint(10 << 9, 10 ** 10) res = self.load(self.API_URL, get={'id': uid}, post=json_dumps([kwargs])) @@ -109,10 +109,10 @@ class MegaCoNz(Hoster): """ Decrypts the file at lastDownload` """ - #: upper 64 bit of counter start + #: Upper 64 bit of counter start n = self.b64_decode(key)[16:24] - #: convert counter to long and shift bytes + #: 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) @@ -130,8 +130,8 @@ class MegaCoNz(Hoster): except IOError, e: self.fail(e) - chunk_size = 2 ** 15 #: buffer size, 32k - #: file_mac = [0, 0, 0, 0] # calculate CBC-MAC for checksum + chunk_size = 2 ** 15 #: Buffer size, 32k + # file_mac = [0, 0, 0, 0] # calculate CBC-MAC for checksum chunks = os.path.getsize(file_crypted) / chunk_size + 1 for i in xrange(chunks): @@ -144,27 +144,27 @@ class MegaCoNz(Hoster): self.pyfile.setProgress(int((100.0 / chunks) * i)) - #: chunk_mac = [iv[0], iv[1], iv[0], iv[1]] - #: for i in xrange(0, chunk_size, 16): - #: block = chunk[i:i+16] - #: if len(block) % 16: - #: block += '=' * (16 - (len(block) % 16)) - #: block = array.array("I", block) + # chunk_mac = [iv[0], iv[1], iv[0], iv[1]] + # for i in xrange(0, chunk_size, 16): + # block = chunk[i:i+16] + # if len(block) % 16: + # block += '=' * (16 - (len(block) % 16)) + # block = array.array("I", block) - #: chunk_mac = [chunk_mac[0] ^ a_[0], chunk_mac[1] ^ block[1], chunk_mac[2] ^ block[2], chunk_mac[3] ^ block[3]] - #: chunk_mac = aes_cbc_encrypt_a32(chunk_mac, k) + # chunk_mac = [chunk_mac[0] ^ a_[0], chunk_mac[1] ^ block[1], chunk_mac[2] ^ block[2], chunk_mac[3] ^ block[3]] + # chunk_mac = aes_cbc_encrypt_a32(chunk_mac, k) - #: file_mac = [file_mac[0] ^ chunk_mac[0], file_mac[1] ^ chunk_mac[1], file_mac[2] ^ chunk_mac[2], file_mac[3] ^ chunk_mac[3]] - #: file_mac = aes_cbc_encrypt_a32(file_mac, k) + # file_mac = [file_mac[0] ^ chunk_mac[0], file_mac[1] ^ chunk_mac[1], file_mac[2] ^ chunk_mac[2], file_mac[3] ^ chunk_mac[3]] + # file_mac = aes_cbc_encrypt_a32(file_mac, k) self.pyfile.setProgress(100) f.close() df.close() - #: if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] != meta_mac: - #: os.remove(file_decrypted) - #: self.fail(_("Checksum mismatch")) + # if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] != meta_mac: + # os.remove(file_decrypted) + # self.fail(_("Checksum mismatch")) os.remove(file_crypted) self.last_download = fs_decode(file_decrypted) @@ -194,8 +194,8 @@ class MegaCoNz(Hoster): self.log_debug("ID: %s" % id, "Key: %s" % key, "Type: %s" % ("public" if public else "node")) - #: g is for requesting a download url - #: this is similar to the calls in the mega js app, documentation is very bad + #: G is for requesting a download url + #: This is similar to the calls in the mega js app, documentation is very bad if public: mega = self.api_response(a="g", g=1, p=id, ssl=1)[0] else: @@ -211,7 +211,7 @@ class MegaCoNz(Hoster): pyfile.name = attr['n'] + self.FILE_SUFFIX pyfile.size = mega['s'] - #: self.req.http.c.setopt(pycurl.SSL_CIPHER_LIST, "RC4-MD5:DEFAULT") + # self.req.http.c.setopt(pycurl.SSL_CIPHER_LIST, "RC4-MD5:DEFAULT") self.download(mega['g']) -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/hoster/MegaCoNz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 9a2726448..66cceda5f 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -190,7 +190,7 @@ class MegaCoNz(Hoster): pattern = re.match(self.__pattern__, pyfile.url).groupdict() id = pattern['ID'] key = pattern['KEY'] - public = pattern['TYPE'] == '' + public = pattern['TYPE'] == "" self.log_debug("ID: %s" % id, "Key: %s" % key, "Type: %s" % ("public" if public else "node")) -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hoster/MegaCoNz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 66cceda5f..94f3fd385 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -49,6 +49,7 @@ class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" __version__ = "0.31" + __status__ = "stable" __pattern__ = r'(https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hoster/MegaCoNz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 94f3fd385..8bec3b37e 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -49,7 +49,7 @@ class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" __version__ = "0.31" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'(https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w,-]+)' -- cgit v1.2.3 From 761ca5c66e07559925ebbdbc6531f9ca658b12ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 16:11:58 +0200 Subject: Code cosmetics --- module/plugins/hoster/MegaCoNz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 8bec3b37e..e4902f2fc 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -163,7 +163,7 @@ class MegaCoNz(Hoster): f.close() df.close() - # if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] != meta_mac: + # if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] not is meta_mac: # os.remove(file_decrypted) # self.fail(_("Checksum mismatch")) -- cgit v1.2.3 From dd13825fbd3df9e441200638cd2a92e3924dfff6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 23:57:04 +0200 Subject: Fix typo --- module/plugins/hoster/MegaCoNz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index e4902f2fc..ad7b06f08 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -163,7 +163,7 @@ class MegaCoNz(Hoster): f.close() df.close() - # if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] not is meta_mac: + # if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] is not meta_mac: # os.remove(file_decrypted) # self.fail(_("Checksum mismatch")) -- cgit v1.2.3 From 2ec703256d3565e2b34c277dcee9fb80019f2f74 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 23:08:59 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1583 --- module/plugins/hoster/MegaCoNz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/MegaCoNz.py') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index ad7b06f08..d8a29817c 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -108,7 +108,7 @@ class MegaCoNz(Hoster): def decrypt_file(self, key): """ - Decrypts the file at lastDownload` + Decrypts the file at last_download` """ #: Upper 64 bit of counter start n = self.b64_decode(key)[16:24] -- cgit v1.2.3