mirror of
https://github.com/p-stream/providers.git
synced 2026-01-11 20:10:33 +00:00
add server mirror embed
This commit is contained in:
parent
49489ca9a5
commit
2f3a73c3d2
2 changed files with 38 additions and 0 deletions
|
|
@ -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<Sourcerer> {
|
|||
export function gatherAllEmbeds(): Array<Embed> {
|
||||
// all embeds are gathered here
|
||||
return [
|
||||
serverMirrorEmbed,
|
||||
upcloudScraper,
|
||||
vidCloudScraper,
|
||||
mixdropScraper,
|
||||
|
|
|
|||
36
src/providers/embeds/server-mirrors.ts
Normal file
36
src/providers/embeds/server-mirrors.ts
Normal file
|
|
@ -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,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
});
|
||||
Loading…
Reference in a new issue