From 381fb89cfba8ff3c985ec2ddb11f65467f59c230 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:11:26 +0000 Subject: [PATCH] feat(source): bring back VidSrc as multi source This reverts commit 1bd85fb4ad038ff979cb372fd0c8577c54aaf775. --- src/source/VidSrc.test.ts | 23 ++++++++++++++++ src/source/VidSrc.ts | 24 +++++++++++++++++ src/source/__snapshots__/VidSrc.test.ts.snap | 27 +++++++++++++++++++ src/source/index.ts | 3 +++ src/utils/__snapshots__/manifest.test.ts.snap | 4 +-- 5 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 src/source/VidSrc.test.ts create mode 100644 src/source/VidSrc.ts create mode 100644 src/source/__snapshots__/VidSrc.test.ts.snap diff --git a/src/source/VidSrc.test.ts b/src/source/VidSrc.test.ts new file mode 100644 index 0000000..a3440c0 --- /dev/null +++ b/src/source/VidSrc.test.ts @@ -0,0 +1,23 @@ +import { createTestContext } from '../test'; +import { ImdbId } from '../utils'; +import { VidSrc } from './VidSrc'; + +const ctx = createTestContext(); + +describe('VidSrc', () => { + let source: VidSrc; + + beforeEach(() => { + source = new VidSrc(); + }); + + test('handle imdb black mirror s4e2', async () => { + const streams = await source.handle(ctx, 'series', new ImdbId('tt2085059', 4, 2)); + expect(streams).toMatchSnapshot(); + }); + + test('handle imdb full metal jacket', async () => { + const streams = await source.handle(ctx, 'series', new ImdbId('tt0093058', undefined, undefined)); + expect(streams).toMatchSnapshot(); + }); +}); diff --git a/src/source/VidSrc.ts b/src/source/VidSrc.ts new file mode 100644 index 0000000..017010b --- /dev/null +++ b/src/source/VidSrc.ts @@ -0,0 +1,24 @@ +import { ContentType } from 'stremio-addon-sdk'; +import { Context, CountryCode } from '../types'; +import { Id } from '../utils'; +import { Source, SourceResult } from './Source'; + +export class VidSrc extends Source { + public readonly id = 'vidsrc'; + + public readonly label = 'VidSrc'; + + public readonly contentTypes: ContentType[] = ['movie', 'series']; + + public readonly countryCodes: CountryCode[] = [CountryCode.multi]; + + public readonly baseUrl = 'https://vidsrc-embed.ru'; + + public async handleInternal(_ctx: Context, _type: string, id: Id): Promise { + const url = id.season + ? new URL(`/embed/tv/${id.id}/${id.season}-${id.episode}`, this.baseUrl) + : new URL(`/embed/movie/${id.id}`, this.baseUrl); + + return [{ url, meta: { countryCodes: [CountryCode.multi] } }]; + }; +} diff --git a/src/source/__snapshots__/VidSrc.test.ts.snap b/src/source/__snapshots__/VidSrc.test.ts.snap new file mode 100644 index 0000000..a857d77 --- /dev/null +++ b/src/source/__snapshots__/VidSrc.test.ts.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing + +exports[`VidSrc handle imdb black mirror s4e2 1`] = ` +[ + { + "meta": { + "countryCodes": [ + "multi", + ], + }, + "url": "https://vidsrc-embed.ru/embed/tv/tt2085059/4-2", + }, +] +`; + +exports[`VidSrc handle imdb full metal jacket 1`] = ` +[ + { + "meta": { + "countryCodes": [ + "multi", + ], + }, + "url": "https://vidsrc-embed.ru/embed/movie/tt0093058", + }, +] +`; diff --git a/src/source/index.ts b/src/source/index.ts index 5d4402f..9d31170 100644 --- a/src/source/index.ts +++ b/src/source/index.ts @@ -17,6 +17,7 @@ import { RgShows } from './RgShows'; import { Source } from './Source'; import { StreamKiste } from './StreamKiste'; import { VerHdLink } from './VerHdLink'; +import { VidSrc } from './VidSrc'; import { VixSrc } from './VixSrc'; export * from './Source'; @@ -31,6 +32,8 @@ export const createSources = (fetcher: Fetcher): Source[] => { new VixSrc(fetcher), // AL new Kokoshka(fetcher), + // EN + new VidSrc(), // ES / MX new CineHDPlus(fetcher), new Cuevana(fetcher), diff --git a/src/utils/__snapshots__/manifest.test.ts.snap b/src/utils/__snapshots__/manifest.test.ts.snap index 19ed3ee..7982062 100644 --- a/src/utils/__snapshots__/manifest.test.ts.snap +++ b/src/utils/__snapshots__/manifest.test.ts.snap @@ -11,7 +11,7 @@ exports[`buildManifest default manifest 1`] = ` "config": [ { "key": "multi", - "title": "Multi 🌐 (4KHDHub, RgShows, VixSrc)", + "title": "Multi 🌐 (4KHDHub, RgShows, VidSrc, VixSrc)", "type": "checkbox", }, { @@ -86,7 +86,7 @@ exports[`buildManifest default manifest 1`] = ` Supported languages: Albanian, German, Castilian Spanish, French, Hindi, Italian, Latin American Spanish, Tamil, Telugu -Supported sources: 4KHDHub, RgShows, VixSrc, Kokoshka, CineHDPlus, Cuevana, HomeCine, VerHdLink, Einschalten, KinoGer, MegaKino, MeineCloud, StreamKiste, Frembed, FrenchCloud, Movix, Eurostreaming, MostraGuarda +Supported sources: 4KHDHub, RgShows, VixSrc, Kokoshka, VidSrc, CineHDPlus, Cuevana, HomeCine, VerHdLink, Einschalten, KinoGer, MegaKino, MeineCloud, StreamKiste, Frembed, FrenchCloud, Movix, Eurostreaming, MostraGuarda Supported extractors: ", "id": "webstreamr",