Enable Autoembed English embed only

This commit is contained in:
TPN 2025-01-08 16:40:48 +05:30 committed by GitHub
parent 1b0eafcca7
commit bba6699de3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

View file

@ -9,25 +9,30 @@ const providers = [
{ {
id: 'autoembed-hindi', id: 'autoembed-hindi',
rank: 9, rank: 9,
disabled: true,
}, },
{ {
id: 'autoembed-tamil', id: 'autoembed-tamil',
rank: 8, rank: 8,
disabled: true,
}, },
{ {
id: 'autoembed-telugu', id: 'autoembed-telugu',
rank: 7, rank: 7,
disabled: true,
}, },
{ {
id: 'autoembed-bengali', id: 'autoembed-bengali',
rank: 6, rank: 6,
disabled: true,
}, },
]; ];
function embed(provider: { id: string; rank: number }) { function embed(provider: { id: string; rank: number; disabled?: boolean }) {
return makeEmbed({ return makeEmbed({
id: provider.id, id: provider.id,
name: provider.id.charAt(0).toUpperCase() + provider.id.slice(1), name: provider.id.split('-').map(word => word[0].toUpperCase() + word.slice(1)).join(' '),
disabled: provider.disabled,
rank: provider.rank, rank: provider.rank,
async scrape(ctx) { async scrape(ctx) {
return { return {

View file

@ -27,11 +27,7 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
for (const stream of fileData) { for (const stream of fileData) {
const url = stream.file; const url = stream.file;
if (!url) continue; if (!url) continue;
const lang = stream.title.toLowerCase().trim(); embeds.push({ embedId: `autoembed-${stream.title.toLowerCase().trim()}`, url });
// only return english
if (lang.includes('english') && url) {
embeds.push({ embedId: `autoembed-${lang}`, url });
}
} }
return { return {