Made downloadObject optional in streamTrack

This commit is contained in:
RemixDev 2021-10-07 14:57:09 +02:00
parent 54374c87e2
commit 7e6202b7f0
No known key found for this signature in database
GPG Key ID: B33962B465BDB51C
1 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ def reverseStreamURL(url):
return reverseStreamPath(urlPart) return reverseStreamPath(urlPart)
def streamTrack(outputStream, track, start=0, downloadObject=None, listener=None): 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} headers= {'User-Agent': USER_AGENT_HEADER}
chunkLength = start chunkLength = start
isCryptedStream = "/mobile/" in track.downloadURL or "/media/" in track.downloadURL 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 isCryptedStream:
if len(chunk) >= 2048: if len(chunk) >= 2048:
chunk = decryptChunk(blowfish_key, chunk[0:2048]) + chunk[2048:] chunk = decryptChunk(blowfish_key, chunk[0:2048]) + chunk[2048:]
if isStart and chunk[0] == 0: if isStart and chunk[0] == 0:
for i, byte in enumerate(chunk): for i, byte in enumerate(chunk):
if byte != 0: break if byte != 0: break