don't get nor renew cookie/token stuff on m3u8 playlists
This commit is contained in:
parent
1a802e7654
commit
ecd5fd3f8b
File diff suppressed because one or more lines are too long
3
index.js
3
index.js
|
@ -69,6 +69,8 @@ async function handler(type, request) {
|
|||
const url = new URL(request.url)
|
||||
const id = url.pathname.split('/')[2]
|
||||
|
||||
// cookie/token stuff isn't needed for m3u8 playlists
|
||||
if (type === 'track') {
|
||||
if (id[0] !== '-') { // checks if not user-upped track
|
||||
license_token = await KV.get('license_token')
|
||||
checkForm = await KV.get('checkForm')
|
||||
|
@ -101,6 +103,7 @@ async function handler(type, request) {
|
|||
await KV.put('access_token', access_token, { expirationTtl: parseInt(json.expires) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
format = url.searchParams.get('f')
|
||||
if (format === null) {
|
||||
|
|
Loading…
Reference in New Issue