mirror of
https://github.com/Inside4ndroid/TMDB-Embed-API.git
synced 2026-10-22 09:35:11 +00:00
remove unused provider
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import express from "express";
|
||||
import { getvidsrc } from "./src/vidsrcpro.js";
|
||||
import { getasiaheroku } from "./src/asiaheroku.js";
|
||||
|
||||
const port = 3000;
|
||||
|
||||
@@ -36,25 +35,6 @@ app.get('/vidsrc/:tmdbId', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/asiaheroku/:tmdbId', async (req, res) => {
|
||||
const id = req.params.tmdbId;
|
||||
const season = req.query.s;
|
||||
const episode = req.query.e;
|
||||
|
||||
try {
|
||||
if (season && episode) {
|
||||
const srcresponse = await getasiaheroku(id, season, episode);
|
||||
res.status(200).json(srcresponse);
|
||||
} else {
|
||||
const vidsrcresponse = await getasiaheroku(id);
|
||||
res.status(200).json(vidsrcresponse);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching data:', error);
|
||||
res.status(500).json({ error: 'Failed to fetch data' });
|
||||
}
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Example app listening on port http://localhost:${port}`);
|
||||
});
|
||||
@@ -1,44 +0,0 @@
|
||||
export async function getasiaheroku(tmdb_id, s, e) {
|
||||
const DOMAIN = "https://asia.heroku.uk/";
|
||||
const headers = {
|
||||
'user-agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
|
||||
'Referer': `${DOMAIN}`,
|
||||
'Origin': `${DOMAIN}`,
|
||||
};
|
||||
|
||||
try {
|
||||
let urlSearch = '';
|
||||
|
||||
if(s && e){
|
||||
urlSearch = `${DOMAIN}/embed/tv/${tmdb_id}/${s}/${e}`;
|
||||
} else {
|
||||
urlSearch = `${DOMAIN}/embed/movie/${tmdb_id}`;
|
||||
}
|
||||
|
||||
const htmlSearch = await fetch(urlSearch, {
|
||||
method: 'GET',
|
||||
headers: headers,
|
||||
});
|
||||
const textSearch = await htmlSearch.text();
|
||||
const sourceMatch = textSearch.match(/<source.?src="(.*?)".?type/);
|
||||
const source = sourceMatch ? sourceMatch[1] : "";
|
||||
const results = {
|
||||
headers: {
|
||||
"Referer": `${DOMAIN}`,
|
||||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
|
||||
"Accept": "*/*"
|
||||
},
|
||||
sources: source,
|
||||
subtitles: 'unsupported'
|
||||
};
|
||||
|
||||
return results;
|
||||
} catch (e) {
|
||||
const results = {
|
||||
headers: {},
|
||||
sources: '',
|
||||
subtitles: ''
|
||||
};
|
||||
return results;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user