Fixed lib not decrypting tracks

This commit is contained in:
RemixDev 2021-07-25 12:51:46 +02:00
parent 7536597495
commit d0cf20db8f
No known key found for this signature in database
GPG Key ID: B33962B465BDB51C
2 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ def streamTrack(outputStream, track, start=0, downloadObject=None, listener=None
if downloadObject.isCanceled: raise DownloadCanceled if 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 isCryptedStream = "/mobile/" in track.downloadURL or "/media/" in track.downloadURL
itemData = { itemData = {
'id': track.id, 'id': track.id,
@ -52,7 +52,7 @@ def streamTrack(outputStream, track, start=0, downloadObject=None, listener=None
} }
try: try:
with get(track.downloadUrl, headers=headers, stream=True, timeout=10) as request: with get(track.downloadURL, headers=headers, stream=True, timeout=10) as request:
request.raise_for_status() request.raise_for_status()
if isCryptedStream: if isCryptedStream:
blowfish_key = generateBlowfishKey(str(track.id)) blowfish_key = generateBlowfishKey(str(track.id))

View File

@ -361,7 +361,7 @@ class Downloader:
if not trackAlreadyDownloaded or self.settings['overwriteFile'] == OverwriteOption.OVERWRITE: if not trackAlreadyDownloaded or self.settings['overwriteFile'] == OverwriteOption.OVERWRITE:
if formatsName[track.bitrate] not in track.urls: if formatsName[track.bitrate] not in track.urls:
track.urls[formatsName[track.bitrate]] = generateCryptedStreamURL(track.id, track.MD5, track.mediaVersion, track.bitrate) track.urls[formatsName[track.bitrate]] = generateCryptedStreamURL(track.id, track.MD5, track.mediaVersion, track.bitrate)
track.downloadUrl = track.urls[formatsName[track.bitrate]] track.downloadURL = track.urls[formatsName[track.bitrate]]
try: try:
with open(writepath, 'wb') as stream: with open(writepath, 'wb') as stream: