fix(extractor): filter by configured languages in VixSrc
This commit is contained in:
parent
c36d444657
commit
b9d0fb3613
3 changed files with 12 additions and 0 deletions
|
|
@ -18,4 +18,10 @@ describe('VixSrc', () => {
|
|||
test('Black Mirror', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://vixsrc.to/tv/42009/4/2'), CountryCode.it, 'Black Mirror 4x2')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('Black Mirror is excluded if no matching language was found', async () => {
|
||||
const ctx = createTestContext({ mediaFlowProxyUrl: 'https://mediaflow-proxy.test', mediaFlowProxyPassword: 'asdfg', de: 'on' });
|
||||
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://vixsrc.to/tv/42009/4/2'), CountryCode.it, 'Black Mirror 4x2')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ export class VixSrc extends Extractor {
|
|||
const playlistUrl = await buildMediaFlowProxyExtractorStreamUrl(ctx, this.fetcher, 'VixCloud', url);
|
||||
const countryCodes = await this.determineCountryCodesFromPlaylist(ctx, playlistUrl);
|
||||
|
||||
if (!countryCodes.some(countryCode => countryCode in ctx.config)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
url: playlistUrl,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ exports[`VixSrc Black Mirror 1`] = `
|
|||
]
|
||||
`;
|
||||
|
||||
exports[`VixSrc Black Mirror is excluded if no matching language was found 1`] = `[]`;
|
||||
|
||||
exports[`VixSrc Full Metal Jacket 1`] = `
|
||||
[
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue