fix(extractor): use Dropload playlist headers also internally
This commit is contained in:
parent
aa820e1f64
commit
7dfc599de9
1 changed files with 3 additions and 2 deletions
|
|
@ -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,
|
||||
},
|
||||
];
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue