From 7e6202b7f025362f6b73c7e7b6bd38dfbeb36e20 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Thu, 7 Oct 2021 14:57:09 +0200 Subject: [PATCH] Made downloadObject optional in streamTrack --- deemix/decryption.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deemix/decryption.py b/deemix/decryption.py index ba0ea8b..2d30946 100644 --- a/deemix/decryption.py +++ b/deemix/decryption.py @@ -41,7 +41,7 @@ def reverseStreamURL(url): return reverseStreamPath(urlPart) def streamTrack(outputStream, track, start=0, downloadObject=None, listener=None): - if downloadObject.isCanceled: raise DownloadCanceled + if downloadObject and downloadObject.isCanceled: raise DownloadCanceled headers= {'User-Agent': USER_AGENT_HEADER} chunkLength = start isCryptedStream = "/mobile/" in track.downloadURL or "/media/" in track.downloadURL @@ -85,7 +85,7 @@ def streamTrack(outputStream, track, start=0, downloadObject=None, listener=None 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