From 2f3a73c3d2da0e5c531b4a4acb334975e39a1dad Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Sun, 23 Nov 2025 16:03:23 -0700 Subject: [PATCH] add server mirror embed --- src/providers/all.ts | 2 ++ src/providers/embeds/server-mirrors.ts | 36 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/providers/embeds/server-mirrors.ts diff --git a/src/providers/all.ts b/src/providers/all.ts index 72bfd27..722b228 100644 --- a/src/providers/all.ts +++ b/src/providers/all.ts @@ -2,6 +2,7 @@ import { Embed, Sourcerer } from '@/providers/base'; import { doodScraper } from '@/providers/embeds/dood'; import { filemoonScraper } from '@/providers/embeds/filemoon'; import { mixdropScraper } from '@/providers/embeds/mixdrop'; +import { serverMirrorEmbed } from '@/providers/embeds/server-mirrors'; import { turbovidScraper } from '@/providers/embeds/turbovid'; import { upcloudScraper } from '@/providers/embeds/upcloud'; import { autoembedScraper } from '@/providers/sources/autoembed'; @@ -150,6 +151,7 @@ export function gatherAllSources(): Array { export function gatherAllEmbeds(): Array { // all embeds are gathered here return [ + serverMirrorEmbed, upcloudScraper, vidCloudScraper, mixdropScraper, diff --git a/src/providers/embeds/server-mirrors.ts b/src/providers/embeds/server-mirrors.ts new file mode 100644 index 0000000..dca8f21 --- /dev/null +++ b/src/providers/embeds/server-mirrors.ts @@ -0,0 +1,36 @@ +import { makeEmbed } from '@/providers/base'; + +export const serverMirrorEmbed = makeEmbed({ + id: 'mirror', + name: 'Mirror', + rank: 1, + async scrape(ctx) { + const context = JSON.parse(ctx.url); + if (context.type === 'hls') { + return { + stream: [ + { + id: 'primary', + type: 'hls', + playlist: context.stream, + headers: context.headers, + flags: context.flags, + captions: context.captions, + }, + ], + }; + } + return { + stream: [ + { + id: 'primary', + type: 'file', + qualities: context.qualities, + flags: context.flags, + captions: context.captions, + headers: context.headers, + }, + ], + }; + }, +});