From ffeefe9b1979d3d51d1702bd6076c066d6eed6d2 Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 27 Oct 2022 17:42:38 +0200 Subject: [PATCH] add public inv api :3 --- server.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server.js b/server.js index 95acf995..15225817 100644 --- a/server.js +++ b/server.js @@ -81,6 +81,7 @@ this is our config file,you can change stuff here */ const config = { tubeApi: "https://tube.kuylar.dev/api/", + invapi: "https://inv.vern.cc/api/v1", dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=", t_url: "https://t.poketube.fun/", // def matomo url }; @@ -623,6 +624,20 @@ app.get("/api/redirect", async (req, res) => { res.redirect(red_url); }); + +app.get("/api/v1/:endpoint/:id", async (req, res) => { + + var inv_api_fetch = await fetch(`${config.invapi}/${req.params.endpoint}/${req.params.id}`).then((res) => + res.text() + ); + + var inv_api_fetch = await JSON.parse(inv_api_fetch); + + res.send(inv_api_fetch) + +}); + + app.get("/api/opensearch", async (req, res) => { res.sendFile(__dirname + `/opensearch.xml`); });