From 846215d5ede9b5bc98e8e265aa9dc28785d72b02 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sat, 21 Nov 2020 17:44:19 +0100 Subject: [PATCH] Fixed downloading issue with some tracks Changed padding type from pkcs7 to just dots --- deemix/utils/decryption.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deemix/utils/decryption.py b/deemix/utils/decryption.py index f510d45..616bbac 100644 --- a/deemix/utils/decryption.py +++ b/deemix/utils/decryption.py @@ -1,7 +1,6 @@ import binascii from Cryptodome.Cipher import Blowfish, AES from Cryptodome.Hash import MD5 -from Cryptodome.Util.Padding import pad def _md5(data): h = MD5.new() @@ -21,7 +20,7 @@ def generateStreamURL(sng_id, md5, media_version, format): [str.encode(md5), str.encode(str(format)), str.encode(str(sng_id)), str.encode(str(media_version))]) md5val = _md5(urlPart) step2 = str.encode(md5val) + b'\xa4' + urlPart + b'\xa4' - step2 = pad(step2, 16) + step2 = step2 + (b'.' * (16 - (len(step2) % 16))) urlPart = binascii.hexlify(AES.new(b'jo6aey6haid2Teih', AES.MODE_ECB).encrypt(step2)) return "https://e-cdns-proxy-" + md5[0] + ".dzcdn.net/mobile/1/" + urlPart.decode("utf-8")