Fixed downloading issue with some tracks

Changed padding type from pkcs7 to just dots
This commit is contained in:
RemixDev 2020-11-21 17:44:19 +01:00
parent ac6a8f8ec4
commit 846215d5ed
No known key found for this signature in database
GPG key ID: B33962B465BDB51C

View file

@ -1,7 +1,6 @@
import binascii import binascii
from Cryptodome.Cipher import Blowfish, AES from Cryptodome.Cipher import Blowfish, AES
from Cryptodome.Hash import MD5 from Cryptodome.Hash import MD5
from Cryptodome.Util.Padding import pad
def _md5(data): def _md5(data):
h = MD5.new() 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))]) [str.encode(md5), str.encode(str(format)), str.encode(str(sng_id)), str.encode(str(media_version))])
md5val = _md5(urlPart) md5val = _md5(urlPart)
step2 = str.encode(md5val) + b'\xa4' + urlPart + b'\xa4' 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)) 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") return "https://e-cdns-proxy-" + md5[0] + ".dzcdn.net/mobile/1/" + urlPart.decode("utf-8")