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
headers= {'User-Agent': USER_AGENT_HEADER}
chunkLength = start
isCryptedStream = "/mobile/" in track.downloadUrl
isCryptedStream = "/mobile/" in track.downloadURL or "/media/" in track.downloadURL
itemData = {
'id': track.id,
@ -52,7 +52,7 @@ def streamTrack(outputStream, track, start=0, downloadObject=None, listener=None
}
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()
if isCryptedStream:
blowfish_key = generateBlowfishKey(str(track.id))

View file

@ -361,7 +361,7 @@ class Downloader:
if not trackAlreadyDownloaded or self.settings['overwriteFile'] == OverwriteOption.OVERWRITE:
if formatsName[track.bitrate] not in track.urls:
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:
with open(writepath, 'wb') as stream: