summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2013-10-02 21:03:07 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2013-10-02 21:03:07 +0200
commit23eafcc9b2dbabbab7af7d24178354c9bbcf561e (patch)
tree88843cb575b443c05da7d910198877c742ccf9be /module
parentPlugins: cosmetics See #286 (diff)
downloadpyload-23eafcc9b2dbabbab7af7d24178354c9bbcf561e.tar.xz
MegaNz: bugfix https://github.com/pyload/pyload/issues/274
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/MegaNz.py13
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):