Made downloadObject optional in streamTrack
This commit is contained in:
parent
54374c87e2
commit
7e6202b7f0
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue