fix(extractor): filter by configured languages in VixSrc

This commit is contained in:
WebStreamr 2025-06-25 20:12:52 +00:00
parent c36d444657
commit b9d0fb3613
No known key found for this signature in database
3 changed files with 12 additions and 0 deletions

View file

@ -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();
});
});

View file

@ -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,

View file

@ -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`] = `
[
{