diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-10-02 21:29:03 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-10-02 21:29:03 +0200 |
commit | b334301ba87b1004d4d4c5d2b3d054cbde475fc1 (patch) | |
tree | 88843cb575b443c05da7d910198877c742ccf9be | |
parent | Plugins: cosmetics See #286 (diff) | |
parent | MegaNz: bugfix https://github.com/pyload/pyload/issues/274 (diff) | |
download | pyload-b334301ba87b1004d4d4c5d2b3d054cbde475fc1.tar.xz |
Merge pull request #289 from vuolter/s/hoster/MegaNz
MegaNz: bugfix https://github.com/pyload/pyload/issues/274
-rw-r--r-- | module/plugins/hoster/MegaNz.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/module/plugins/hoster/MegaNz.py b/module/plugins/hoster/MegaNz.py index db97f6859..bf4223213 100644 --- a/module/plugins/hoster/MegaNz.py +++ b/module/plugins/hoster/MegaNz.py @@ -20,7 +20,7 @@ class MegaNz(Hoster): __name__ = "MegaNz" __type__ = "hoster" __pattern__ = r"https?://([a-z0-9]+\.)?mega\.co\.nz/#!([a-zA-Z0-9!_\-]+)" - __version__ = "0.13" + __version__ = "0.14" __description__ = """mega.co.nz hoster plugin""" __author_name__ = ("RaNaN", ) __author_mail__ = ("ranan@pyload.org", ) @@ -69,8 +69,11 @@ class MegaNz(Hoster): cipher = AES.new(self.getCipherKey(key), AES.MODE_CTR, counter=ctr) self.pyfile.setStatus("decrypting") - f = open(self.lastDownload, "rb") - df = open(self.lastDownload.rsplit(self.FILE_SUFFIX)[0], "wb") + + file_crypted = self.lastDownload + file_decrypted = file_crypted.rsplit(self.FILE_SUFFIX)[0] + f = open(file_crypted, "rb") + df = open(file_decrypted, "wb") # TODO: calculate CBC-MAC for checksum @@ -84,7 +87,9 @@ class MegaNz(Hoster): f.close() df.close() - remove(self.lastDownload) + remove(file_crypted) + + self.lastDownload = file_decrypted def process(self, pyfile): |