fix(extractor): use Dropload playlist headers also internally

This commit is contained in:
WebStreamr 2026-03-02 13:02:34 +00:00
parent aa820e1f64
commit 7dfc599de9
No known key found for this signature in database

View file

@ -28,11 +28,12 @@ export class Dropload extends Extractor {
}
const playlistUrl = extractUrlFromPacked(html, [/sources:\[{file:"(.*?)"/]);
const playlistHeaders = { Referer: url.origin };
const heightMatch = html.match(/\d{3,}x(\d{3,}),/);
const height = heightMatch
? parseInt(heightMatch[1] as string)
: meta.height ?? await guessHeightFromPlaylist(ctx, this.fetcher, playlistUrl);
: meta.height ?? await guessHeightFromPlaylist(ctx, this.fetcher, playlistUrl, { headers: playlistHeaders });
const sizeMatch = html.match(/([\d.]+ ?[GM]B)/);
const size = sizeMatch ? bytes.parse(sizeMatch[1] as string) as number : undefined;
@ -50,7 +51,7 @@ export class Dropload extends Extractor {
...(size && { bytes: size }),
...(height && { height }),
},
requestHeaders: { Referer: url.origin },
requestHeaders: playlistHeaders,
},
];
};