Refactored media fetch with undici for http/2 support.

This commit is contained in:
DebaucheryLibrarian
2026-04-02 04:45:31 +02:00
parent 6cabfc3090
commit a96ec64d61
9 changed files with 205 additions and 934 deletions

View File

@@ -651,9 +651,10 @@ async function fetchHttpSource(source, tempFileTarget, hashStream) {
const res = await http.get(source.src, {
limits: 'media',
headers: {
host: new URL(source.src).hostname,
// explicit host not allowed in HTTP/2
// host: new URL(source.src).hostname,
// ...(source.host && { host: source.host }),
...(source.referer && { referer: source.referer }),
...(source.host && { host: source.host }),
},
stream: true, // sources are fetched in parallel, don't gobble up memory
followRedirects: source.followRedirects,