mirror of
https://github.com/sussy-code/providers.git
synced 2026-03-11 17:55:37 +00:00
Merge all autoembed embeds in one file
This commit is contained in:
parent
a0d4cb8243
commit
cf161e7cd5
7 changed files with 62 additions and 87 deletions
|
|
@ -25,11 +25,13 @@ import { tugaflixScraper } from '@/providers/sources/tugaflix';
|
|||
import { vidsrcScraper } from '@/providers/sources/vidsrc/index';
|
||||
import { zoechipScraper } from '@/providers/sources/zoechip';
|
||||
|
||||
import { autoembedBenagaliScraper } from './embeds/autoembed/bengali';
|
||||
import { autoembedEnglishScraper } from './embeds/autoembed/english';
|
||||
import { autoembedHindiScraper } from './embeds/autoembed/hindi';
|
||||
import { autoembedTamilScraper } from './embeds/autoembed/tamil';
|
||||
import { autoembedTeluguScraper } from './embeds/autoembed/telugu';
|
||||
import {
|
||||
autoembedBengaliScraper,
|
||||
autoembedEnglishScraper,
|
||||
autoembedHindiScraper,
|
||||
autoembedTamilScraper,
|
||||
autoembedTeluguScraper,
|
||||
} from './embeds/autoembed';
|
||||
import { bflixScraper } from './embeds/bflix';
|
||||
import { closeLoadScraper } from './embeds/closeload';
|
||||
import { fileMoonScraper } from './embeds/filemoon';
|
||||
|
|
@ -126,7 +128,7 @@ export function gatherAllEmbeds(): Array<Embed> {
|
|||
hydraxScraper,
|
||||
autoembedEnglishScraper,
|
||||
autoembedHindiScraper,
|
||||
autoembedBenagaliScraper,
|
||||
autoembedBengaliScraper,
|
||||
autoembedTamilScraper,
|
||||
autoembedTeluguScraper,
|
||||
];
|
||||
|
|
|
|||
54
src/providers/embeds/autoembed.ts
Normal file
54
src/providers/embeds/autoembed.ts
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
const providers = [
|
||||
{
|
||||
id: 'autoembed-english',
|
||||
rank: 10,
|
||||
},
|
||||
{
|
||||
id: 'autoembed-hindi',
|
||||
rank: 9,
|
||||
},
|
||||
{
|
||||
id: 'autoembed-tamil',
|
||||
rank: 8,
|
||||
},
|
||||
{
|
||||
id: 'autoembed-telugu',
|
||||
rank: 7,
|
||||
},
|
||||
{
|
||||
id: 'autoembed-bengali',
|
||||
rank: 6,
|
||||
},
|
||||
];
|
||||
|
||||
function embed(provider: { id: string; rank: number }) {
|
||||
return makeEmbed({
|
||||
id: provider.id,
|
||||
name: provider.id.charAt(0).toUpperCase() + provider.id.slice(1),
|
||||
rank: provider.rank,
|
||||
async scrape(ctx) {
|
||||
return {
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'hls',
|
||||
playlist: ctx.url,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
captions: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export const [
|
||||
autoembedEnglishScraper,
|
||||
autoembedHindiScraper,
|
||||
autoembedBengaliScraper,
|
||||
autoembedTamilScraper,
|
||||
autoembedTeluguScraper,
|
||||
] = providers.map(embed);
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
import { autoembedEnglishScraper } from './english';
|
||||
|
||||
export const autoembedBenagaliScraper = makeEmbed({
|
||||
id: 'autoembed-bengali',
|
||||
name: 'Bengali',
|
||||
rank: 7,
|
||||
async scrape(ctx) {
|
||||
const result = await autoembedEnglishScraper.scrape(ctx);
|
||||
return {
|
||||
stream: result.stream,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
export const autoembedEnglishScraper = makeEmbed({
|
||||
id: 'autoembed-english',
|
||||
name: 'English',
|
||||
rank: 10,
|
||||
scrape: async (ctx) => {
|
||||
return {
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'hls',
|
||||
playlist: ctx.url,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
captions: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
import { autoembedEnglishScraper } from './english';
|
||||
|
||||
export const autoembedHindiScraper = makeEmbed({
|
||||
id: 'autoembed-hindi',
|
||||
name: 'Hindi',
|
||||
rank: 9,
|
||||
async scrape(ctx) {
|
||||
const result = await autoembedEnglishScraper.scrape(ctx);
|
||||
return {
|
||||
stream: result.stream,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
import { autoembedEnglishScraper } from './english';
|
||||
|
||||
export const autoembedTamilScraper = makeEmbed({
|
||||
id: 'autoembed-tamil',
|
||||
name: 'Tamil',
|
||||
rank: 8,
|
||||
async scrape(ctx) {
|
||||
const result = await autoembedEnglishScraper.scrape(ctx);
|
||||
return {
|
||||
stream: result.stream,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
import { autoembedEnglishScraper } from './english';
|
||||
|
||||
export const autoembedTeluguScraper = makeEmbed({
|
||||
id: 'autoembed-telugu',
|
||||
name: 'Telugu',
|
||||
rank: 6,
|
||||
async scrape(ctx) {
|
||||
const result = await autoembedEnglishScraper.scrape(ctx);
|
||||
return {
|
||||
stream: result.stream,
|
||||
};
|
||||
},
|
||||
});
|
||||
Loading…
Reference in a new issue