replaced Number() with parseInt()
This commit is contained in:
parent
827da7a0f8
commit
a5603af1ed
File diff suppressed because one or more lines are too long
6
index.js
6
index.js
|
@ -27,7 +27,7 @@ async function handler(type, request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
access_token = json.access_token
|
access_token = json.access_token
|
||||||
await KV.put('access_token', access_token, { expirationTtl: Number(json.expires) })
|
await KV.put('access_token', access_token, { expirationTtl: parseInt(json.expires) })
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = new URL(request.url)
|
const url = new URL(request.url)
|
||||||
|
@ -150,7 +150,7 @@ async function track(id, format, access_token, tagging) {
|
||||||
|
|
||||||
const cipher = new wasm.Cipher(id)
|
const cipher = new wasm.Cipher(id)
|
||||||
|
|
||||||
const length = Number(track.headers.get('Content-Length'))
|
const length = parseInt(track.headers.get('Content-Length'))
|
||||||
|
|
||||||
pipeDecryptedStream(writer, track.body, length, cipher)
|
pipeDecryptedStream(writer, track.body, length, cipher)
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ async function m3u8(type, id, format, access_token, tagging) {
|
||||||
if (track.id < 0) { // user-uploaded track
|
if (track.id < 0) { // user-uploaded track
|
||||||
format = 'misc'
|
format = 'misc'
|
||||||
}
|
}
|
||||||
let result = `https://dz.uhwot.workers.dev/track/${track.id}?f=${format}&t=${Number(tagging)}`
|
let result = `https://dz.uhwot.workers.dev/track/${track.id}?f=${format}&t=${+ tagging}`
|
||||||
list += `#EXTINF:${track.duration},${track.title}\n${result}\n`
|
list += `#EXTINF:${track.duration},${track.title}\n${result}\n`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue