fixed decrypt_track function
This commit is contained in:
parent
92d24aca83
commit
ecc9b91d90
|
@ -242,14 +242,13 @@ class Deezer:
|
||||||
response = open(input, 'rb')
|
response = open(input, 'rb')
|
||||||
outfile = open(output, 'wb')
|
outfile = open(output, 'wb')
|
||||||
blowfish_key = str.encode(self._get_blowfish_key(str(track_id)))
|
blowfish_key = str.encode(self._get_blowfish_key(str(track_id)))
|
||||||
blowfish = Blowfish.new(blowfish_key, Blowfish.MODE_CBC, b"\x00\x01\x02\x03\x04\x05\x06\x07")
|
|
||||||
i = 0
|
i = 0
|
||||||
while True:
|
while True:
|
||||||
chunk = response.read(2048)
|
chunk = response.read(2048)
|
||||||
if not chunk:
|
if not chunk:
|
||||||
break
|
break
|
||||||
if (i % 3) == 0 and len(chunk) == 2048:
|
if (i % 3) == 0 and len(chunk) == 2048:
|
||||||
chunk = blowfish.decrypt(chunk)
|
chunk = Blowfish.new(blowfish_key, Blowfish.MODE_CBC, b"\x00\x01\x02\x03\x04\x05\x06\x07").decrypt(chunk)
|
||||||
outfile.write(chunk)
|
outfile.write(chunk)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue