Fixed BAD STARTING SYNC issue when downloading some MP3s

This commit is contained in:
RemixDev 2021-09-23 14:16:32 +02:00
parent 93fa5fd8a1
commit 09857b1247
1 changed files with 7 additions and 0 deletions

View File

@ -80,11 +80,18 @@ def streamTrack(outputStream, track, start=0, downloadObject=None, listener=None
'value': complete
})
isStart = True
for chunk in request.iter_content(2048 * 3):
if isCryptedStream:
if len(chunk) >= 2048:
chunk = decryptChunk(blowfish_key, chunk[0:2048]) + chunk[2048:]
if isStart and chunk[0] == 0:
for i, byte in enumerate(chunk):
if byte != 0: break
chunk = chunk[i:]
isStart = False
outputStream.write(chunk)
chunkLength += len(chunk)