Change names to embedsu, add correct quality parsing and change routes, parse subtitle languages and format them in ISO 639-1:2002 standard

This commit is contained in:
An0n-00
2025-02-15 14:58:26 +01:00
parent 8c07b87676
commit ef59e4bf68
7 changed files with 396 additions and 187 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
import express from "express";
import { getvidsrc } from "./src/vidsrcpro.js";
import { getEmbedSu } from "./src/embedsu.js";
const port = 3000;
@@ -9,24 +9,24 @@ app.get('/', (req, res) => {
res.status(200).json({
intro: "Welcome to the unofficial vidsrcPro provider",
routes: {
movie: "/vidsrc/:movieTMDBid",
show: "/vidsrc/:showTMDBid?s=seasonNumber&e=episodeNumber"
movie: "/embedsu/:movieTMDBid",
show: "/embedsu/:showTMDBid?s=seasonNumber&e=episodeNumber"
},
author: "This api is developed and created by Inside4ndroid Studios"
});
});
app.get('/vidsrc/:tmdbId', async (req, res) => {
app.get('/embedsu/:tmdbId', async (req, res) => {
const id = req.params.tmdbId;
const season = req.query.s;
const episode = req.query.e;
try {
if (season && episode) {
const vidsrcresponse = await getvidsrc(id, season, episode);
const vidsrcresponse = await getEmbedSu(id, season, episode);
res.status(200).json(vidsrcresponse);
} else {
const vidsrcresponse = await getvidsrc(id);
const vidsrcresponse = await getEmbedSu(id);
res.status(200).json(vidsrcresponse);
}
} catch (error) {