summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Gonzalo SR <gonzalo@gonzalosr.com> 2013-02-14 13:02:11 +0100
committerGravatar Gonzalo SR <gonzalo@gonzalosr.com> 2013-02-14 13:02:11 +0100
commit5221eda1ad0fbfa26b01cf66354a5415141adf4a (patch)
tree8413de3e2bd3328a5576795c3ca3bd76ad4500ae /module
parentMerge pull request #3 from irrenhaus/stable (diff)
downloadpyload-5221eda1ad0fbfa26b01cf66354a5415141adf4a.tar.xz
Support for incorrectly padded Mega.co.nz keys
Sometimes base64 Mega keys are incorrectly padded. Ugly hack to add padding characters as needed.
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/MegaNz.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/plugins/hoster/MegaNz.py b/module/plugins/hoster/MegaNz.py
index 1c48906ca..6644d372c 100644
--- a/module/plugins/hoster/MegaNz.py
+++ b/module/plugins/hoster/MegaNz.py
@@ -28,7 +28,8 @@ class MegaNz(Hoster):
FILE_SUFFIX = ".crypted"
def b64_decode(self, data):
- return standard_b64decode(data.replace("-", "+").replace("_", "/")+ "=")
+ data = data.replace("-", "+").replace("_", "/")
+ return standard_b64decode(data + '=' * (-len(data) % 4))
def getCipherKey(self, key):
""" Construct the cipher key from the given data """