From b9d0fb361383fcfdb6b3532faa19033451ea94fa Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:12:52 +0000 Subject: [PATCH] fix(extractor): filter by configured languages in VixSrc --- src/extractor/VixSrc.test.ts | 6 ++++++ src/extractor/VixSrc.ts | 4 ++++ src/extractor/__snapshots__/VixSrc.test.ts.snap | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/extractor/VixSrc.test.ts b/src/extractor/VixSrc.test.ts index ccfc32f..c373408 100644 --- a/src/extractor/VixSrc.test.ts +++ b/src/extractor/VixSrc.test.ts @@ -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(); + }); }); diff --git a/src/extractor/VixSrc.ts b/src/extractor/VixSrc.ts index 696d85e..b7668c9 100644 --- a/src/extractor/VixSrc.ts +++ b/src/extractor/VixSrc.ts @@ -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, diff --git a/src/extractor/__snapshots__/VixSrc.test.ts.snap b/src/extractor/__snapshots__/VixSrc.test.ts.snap index b86c314..ea3e165 100644 --- a/src/extractor/__snapshots__/VixSrc.test.ts.snap +++ b/src/extractor/__snapshots__/VixSrc.test.ts.snap @@ -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`] = ` [ {