stream: use freebind dispatcher in internal streams

This commit is contained in:
dumbmoron
2024-05-12 16:35:52 +00:00
parent d5aa27f5f9
commit 9419266cd7
4 changed files with 20 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ async function* readChunks(streamInfo, size) {
...getHeaders('youtube'),
Range: `bytes=${read}-${read + CHUNK_SIZE}`
},
dispatcher: streamInfo.dispatcher,
signal: streamInfo.controller.signal
});
@@ -47,6 +48,7 @@ async function handleYoutubeStream(streamInfo, res) {
const req = await fetch(streamInfo.url, {
headers: getHeaders('youtube'),
method: 'HEAD',
dispatcher: streamInfo.dispatcher,
signal: streamInfo.controller.signal
});
@@ -81,6 +83,7 @@ export async function internalStream(streamInfo, res) {
...streamInfo.headers,
host: undefined
},
dispatcher: streamInfo.dispatcher,
signal: streamInfo.controller.signal,
maxRedirections: 16
});