diff --git a/src/extractor/VixSrc.test.ts b/src/extractor/VixSrc.test.ts index 41214de..c73ffb4 100644 --- a/src/extractor/VixSrc.test.ts +++ b/src/extractor/VixSrc.test.ts @@ -7,7 +7,7 @@ import { VixSrc } from './VixSrc'; const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); const extractorRegistry = new ExtractorRegistry(logger, [new VixSrc(new FetcherMock(`${__dirname}/__fixtures__/VixSrc`))]); -const ctx = createTestContext({ de: 'on', en: 'on', it: 'on' }); +const ctx = createTestContext(); describe('VixSrc', () => { test('Full Metal Jacket', async () => { @@ -18,6 +18,10 @@ describe('VixSrc', () => { expect(await extractorRegistry.handle(ctx, new URL('https://vixsrc.to/tv/42009/4/2'))).toMatchSnapshot(); }); + test('Rental Family', async () => { + expect(await extractorRegistry.handle(ctx, new URL('https://vixsrc.to/movie/1208348'))).toMatchSnapshot(); + }); + test('Black Mirror is excluded if no matching language was found', async () => { const ctx = createTestContext({ de: 'on' }); diff --git a/src/extractor/VixSrc.ts b/src/extractor/VixSrc.ts index f344e3a..fcab676 100644 --- a/src/extractor/VixSrc.ts +++ b/src/extractor/VixSrc.ts @@ -1,9 +1,5 @@ import { Context, CountryCode, Format, Meta, UrlResult } from '../types'; -import { - CustomRequestConfig, - guessHeightFromPlaylist, hasMultiEnabled, - iso639FromCountryCode, -} from '../utils'; +import { CustomRequestConfig, guessHeightFromPlaylist, hasMultiEnabled, iso639FromCountryCode } from '../utils'; import { Extractor } from './Extractor'; export class VixSrc extends Extractor { @@ -46,7 +42,7 @@ export class VixSrc extends Extractor { ttl: this.ttl, meta: { ...meta, - countryCodes, + countryCodes: countryCodes.length ? countryCodes : [CountryCode.multi], height: meta.height ?? await guessHeightFromPlaylist(ctx, this.fetcher, playlistUrl, { headers }), }, }, @@ -56,7 +52,7 @@ export class VixSrc extends Extractor { private async determineCountryCodesFromPlaylist(ctx: Context, playlistUrl: URL, init?: CustomRequestConfig): Promise { const playlist = await this.fetcher.text(ctx, playlistUrl, init); - const countryCodes: CountryCode[] = [CountryCode.it]; + const countryCodes: CountryCode[] = []; (Object.keys(CountryCode) as CountryCode[]).forEach((countryCode) => { const iso639 = iso639FromCountryCode(countryCode); diff --git a/src/extractor/__fixtures__/VixSrc/https:vixsrc.tomovie1208348 b/src/extractor/__fixtures__/VixSrc/https:vixsrc.tomovie1208348 new file mode 100644 index 0000000..bd2a18c --- /dev/null +++ b/src/extractor/__fixtures__/VixSrc/https:vixsrc.tomovie1208348 @@ -0,0 +1,67 @@ + + + + + + 612252 + + + + + + + + + + + + +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/extractor/__fixtures__/VixSrc/https:vixsrc.toplaylist612252.m3u8tokend4118614964ebe7f00430371d305378dandexpires1773654453andh1 b/src/extractor/__fixtures__/VixSrc/https:vixsrc.toplaylist612252.m3u8tokend4118614964ebe7f00430371d305378dandexpires1773654453andh1 new file mode 100644 index 0000000..7644de3 --- /dev/null +++ b/src/extractor/__fixtures__/VixSrc/https:vixsrc.toplaylist612252.m3u8tokend4118614964ebe7f00430371d305378dandexpires1773654453andh1 @@ -0,0 +1,11 @@ +#EXTM3U +#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English [CC]",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="eng",URI="https://vixsrc.to/playlist/612252?type=subtitle&rendition=eng-2&token=A4DdWVOC-Zk7oVrYIQU3bA&expires=1773654453&edge=sc-u9-01" +#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English [Forced]",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="eng-forced",URI="https://vixsrc.to/playlist/612252?type=subtitle&rendition=eng-forced-3&token=A4DdWVOC-Zk7oVrYIQU3bA&expires=1773654453&edge=sc-u9-01" +#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="French",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="fre",URI="https://vixsrc.to/playlist/612252?type=subtitle&rendition=fre-4&token=A4DdWVOC-Zk7oVrYIQU3bA&expires=1773654453&edge=sc-u9-01" +#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Spanish",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="spa",URI="https://vixsrc.to/playlist/612252?type=subtitle&rendition=spa-5&token=A4DdWVOC-Zk7oVrYIQU3bA&expires=1773654453&edge=sc-u9-01" +#EXT-X-STREAM-INF:BANDWIDTH=4500000,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=1920x1080,SUBTITLES="subs" +https://vixsrc.to/playlist/612252?type=video&rendition=1080p&token=ILslAWZ4iHG13XwOYOr42g&expires=1773654453&edge=sc-u9-01 +#EXT-X-STREAM-INF:BANDWIDTH=1800000,CODECS="avc1.64001f,mp4a.40.2",RESOLUTION=1280x720,SUBTITLES="subs" +https://vixsrc.to/playlist/612252?type=video&rendition=720p&token=9LPJeLV-X45xQ9bKCLyYFA&expires=1773654453&edge=sc-u9-01 +#EXT-X-STREAM-INF:BANDWIDTH=720000,CODECS="avc1.640015,mp4a.40.2",RESOLUTION=640x360,SUBTITLES="subs" +https://vixsrc.to/playlist/612252?type=video&rendition=360p&token=CQDIdX_LN3QdQ9yFRDMNlA&expires=1773654453&edge=sc-u9-01 \ No newline at end of file diff --git a/src/extractor/__snapshots__/VixSrc.test.ts.snap b/src/extractor/__snapshots__/VixSrc.test.ts.snap index 6b4f3c1..9bf12ef 100644 --- a/src/extractor/__snapshots__/VixSrc.test.ts.snap +++ b/src/extractor/__snapshots__/VixSrc.test.ts.snap @@ -7,8 +7,8 @@ exports[`VixSrc Black Mirror 1`] = ` "label": "VixSrc", "meta": { "countryCodes": [ - "it", "en", + "it", ], "extractorId": "vixsrc", "height": 1080, @@ -28,8 +28,8 @@ exports[`VixSrc Full Metal Jacket 1`] = ` "label": "VixSrc", "meta": { "countryCodes": [ - "it", "en", + "it", ], "extractorId": "vixsrc", "height": 1080, @@ -39,3 +39,21 @@ exports[`VixSrc Full Metal Jacket 1`] = ` }, ] `; + +exports[`VixSrc Rental Family 1`] = ` +[ + { + "format": "hls", + "label": "VixSrc", + "meta": { + "countryCodes": [ + "multi", + ], + "extractorId": "vixsrc", + "height": 1080, + }, + "ttl": 21600000, + "url": "https://vixsrc.to/playlist/612252.m3u8?token=d4118614964ebe7f00430371d305378d&expires=1773654453&h=1", + }, +] +`;