fix(extractor): improve messy meta type
This commit is contained in:
parent
904f5de3e0
commit
7f2cf10021
2 changed files with 4 additions and 4 deletions
|
|
@ -23,9 +23,9 @@ export abstract class Extractor {
|
|||
return url;
|
||||
};
|
||||
|
||||
protected abstract extractInternal(ctx: Context, url: URL, meta?: Meta): Promise<UrlResult[]>;
|
||||
protected abstract extractInternal(ctx: Context, url: URL, meta: Meta): Promise<UrlResult[]>;
|
||||
|
||||
public async extract(ctx: Context, url: URL, meta?: Meta): Promise<UrlResult[]> {
|
||||
public async extract(ctx: Context, url: URL, meta: Meta): Promise<UrlResult[]> {
|
||||
try {
|
||||
return await this.extractInternal(ctx, url, meta);
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ describe('VidSrc', () => {
|
|||
const fetcher = new Fetcher(winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }));
|
||||
const vidSrc = new VidSrc(fetcher, ['net', 'xyz']);
|
||||
|
||||
expect(await vidSrc.extract(ctx, new URL('https://vidsrc.xyz/embed/movie/tt33043892/1/1'))).toMatchSnapshot();
|
||||
expect(await vidSrc.extract(ctx, new URL('https://vidsrc.xyz/embed/movie/tt33043892/1/1'), {})).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('blocking issues are retried and fail if no tlds are left', async () => {
|
||||
|
|
@ -52,6 +52,6 @@ describe('VidSrc', () => {
|
|||
const fetcher = new Fetcher(winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }));
|
||||
const vidSrc = new VidSrc(fetcher, ['net', 'xyz']);
|
||||
|
||||
expect(await vidSrc.extract(ctx, new URL('https://vidsrc.xyz/embed/movie/tt33043892/1/1'))).toMatchSnapshot();
|
||||
expect(await vidSrc.extract(ctx, new URL('https://vidsrc.xyz/embed/movie/tt33043892/1/1'), {})).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue