removed the need for language map an display full language label.

This commit is contained in:
Inside4ndroid
2025-03-10 09:13:49 +00:00
parent 44cf0088fe
commit 33b261dd9d
3 changed files with 8 additions and 129 deletions
+6 -1
View File
@@ -1,5 +1,5 @@
import express from "express"; import express from "express";
import { getEmbedSu } from "./src/embedsu.js"; import { getEmbedSu } from "./src/extractors/embedsu.js";
const port = 3000; const port = 3000;
@@ -35,6 +35,11 @@ app.get('/embedsu/:tmdbId', async (req, res) => {
} }
}); });
app.get('/vidsr-net/:tmdbid', async (req, res) => {
})
app.listen(port, () => { app.listen(port, () => {
console.log(`Example app listening on port http://localhost:${port}`); console.log(`Example app listening on port http://localhost:${port}`);
}); });
+2 -2
View File
@@ -1,5 +1,5 @@
import fetch from 'node-fetch'; import fetch from 'node-fetch';
import { languageMap } from './languages.js'; import { languageMap } from '../utils/languages.js';
export async function getEmbedSu(tmdb_id, s, e) { export async function getEmbedSu(tmdb_id, s, e) {
const DOMAIN = "https://embed.su"; const DOMAIN = "https://embed.su";
@@ -43,7 +43,7 @@ export async function getEmbedSu(tmdb_id, s, e) {
const tracks = dataDirect.subtitles.map(sub => ({ const tracks = dataDirect.subtitles.map(sub => ({
url: sub.file, url: sub.file,
lang: languageMap[sub.label.split(' ')[0]] || sub.label lang: sub.label.split('-')[0].trim()
})).filter(track => track.lang); })).filter(track => track.lang);
const requestDirectSize = await fetch(dataDirect.source, { headers, method: "GET" }); const requestDirectSize = await fetch(dataDirect.source, { headers, method: "GET" });
-126
View File
@@ -1,126 +0,0 @@
export const languageMap = {
"Abkhazian": "ab",
"Afar": "aa",
"Afrikaans": "af",
"Albanian": "sq",
"Amharic": "am",
"Arabic": "ar",
"Aragonese": "an",
"Armenian": "hy",
"Assamese": "as",
"Aymara": "ay",
"Azerbaijani": "az",
"Bashkir": "ba",
"Basque": "eu",
"Bengali": "bn",
"Bihari": "bh",
"Bislama": "bi",
"Bosnian": "bs",
"Breton": "br",
"Bulgarian": "bg",
"Burmese": "my",
"Catalan": "ca",
"Chinese": "zh",
"Chuvash": "cv",
"Cornish": "kw",
"Corsican": "co",
"Croatian": "hr",
"Czech": "cs",
"Danish": "da",
"Dutch": "nl",
"Dzongkha": "dz",
"English": "en",
"Esperanto": "eo",
"Estonian": "et",
"Ewe": "ee",
"Fijian": "fj",
"Finnish": "fi",
"French": "fr",
"Georgian": "ka",
"German": "de",
"Greek": "el",
"Guaraní": "gn",
"Gujarati": "gu",
"Haitian Creole": "ht",
"Hausa": "ha",
"Hawaiian": "haw",
"Hebrew": "he",
"Hindi": "hi",
"Hmong": "hmn",
"Hungarian": "hu",
"Icelandic": "is",
"Igbo": "ig",
"Indonesian": "id",
"Interlingua": "ia",
"Irish": "ga",
"Italian": "it",
"Japanese": "ja",
"Javanese": "jv",
"Kannada": "kn",
"Kazakh": "kk",
"Khmer": "km",
"Kinyarwanda": "rw",
"Korean": "ko",
"Kurdish": "ku",
"Kyrgyz": "ky",
"Lao": "lo",
"Latin": "la",
"Latvian": "lv",
"Lingala": "ln",
"Lithuanian": "lt",
"Luxembourgish": "lb",
"Macedonian": "mk",
"Malagasy": "mg",
"Malay": "ms",
"Malayalam": "ml",
"Maltese": "mt",
"Maori": "mi",
"Marathi": "mr",
"Mongolian": "mn",
"Nepali": "ne",
"Norwegian": "no",
"Occitan": "oc",
"Oromo": "om",
"Pashto": "ps",
"Persian": "fa",
"Polish": "pl",
"Portuguese": "pt",
"Quechua": "qu",
"Romanian": "ro",
"Russian": "ru",
"Samoan": "sm",
"Sanskrit": "sa",
"Scots Gaelic": "gd",
"Serbian": "sr",
"Sesotho": "st",
"Shona": "sn",
"Sindhi": "sd",
"Sinhalese": "si",
"Slovak": "sk",
"Slovenian": "sl",
"Somali": "so",
"Spanish": "es",
"Sundanese": "su",
"Swahili": "sw",
"Swedish": "sv",
"Tajik": "tg",
"Tamil": "ta",
"Tatar": "tt",
"Telugu": "te",
"Thai": "th",
"Tigrinya": "ti",
"Turkish": "tr",
"Turkmen": "tk",
"Ukrainian": "uk",
"Urdu": "ur",
"Uzbek": "uz",
"Vietnamese": "vi",
"Volapük": "vo",
"Walloon": "wa",
"Welsh": "cy",
"Wolof": "wo",
"Xhosa": "xh",
"Yiddish": "yi",
"Yoruba": "yo",
"Zulu": "zu"
};