fixed decrypting tracks with fallback
This commit is contained in:
parent
e96b2ade6d
commit
6994f35062
File diff suppressed because one or more lines are too long
7
index.js
7
index.js
|
@ -184,6 +184,11 @@ async function track(id, format, access_token, tagging) {
|
|||
writer.write(id3.arrayBuffer)
|
||||
}
|
||||
|
||||
// needed if track has fallback, like https://www.deezer.com/track/11835714
|
||||
if (json.alternative) {
|
||||
id = json.alternative.id.toString()
|
||||
}
|
||||
|
||||
const bfKey = await bf_key(id)
|
||||
const length = Number(track.headers.get('Content-Length'))
|
||||
|
||||
|
@ -231,7 +236,7 @@ async function pipeDecryptedStream(writer, body, length, bfKey) {
|
|||
}
|
||||
|
||||
async function track_url(json, format) {
|
||||
// needed if track has fallback, like https://www.deezer.com/track/1398759152
|
||||
// needed if track has fallback, like https://www.deezer.com/track/11835714
|
||||
if (json.alternative) {
|
||||
json = json.alternative
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue