mirror of
https://github.com/Inside4ndroid/TMDB-Embed-API.git
synced 2026-10-22 17:45:11 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user