mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 03:54:41 -05:00
add new url
This commit is contained in:
parent
b1ed5d7dae
commit
320381fe89
1 changed files with 3 additions and 1 deletions
|
@ -62,7 +62,7 @@ const proxy = async (req, res) => {
|
||||||
let url;
|
let url;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
url = new URL("https://" + req.originalUrl.slice(10));
|
url = new URL("https://" + req.originalUrl.slice(8));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("==> Cannot parse URL: " + e);
|
console.log("==> Cannot parse URL: " + e);
|
||||||
return res.status(400).send("Malformed URL");
|
return res.status(400).send("Malformed URL");
|
||||||
|
@ -105,6 +105,7 @@ app.get("/", (req, res) => {
|
||||||
const apiUrls = [
|
const apiUrls = [
|
||||||
"https://returnyoutubedislikeapi.com/votes?videoId=",
|
"https://returnyoutubedislikeapi.com/votes?videoId=",
|
||||||
"https://ipv6-t.poketube.fun/api?v=",
|
"https://ipv6-t.poketube.fun/api?v=",
|
||||||
|
"https://prod-poketube.testing.poketube.fun/api?v="
|
||||||
];
|
];
|
||||||
|
|
||||||
// Define a cache object
|
// Define a cache object
|
||||||
|
@ -142,6 +143,7 @@ app.get("/api", async (req, res) => {
|
||||||
// Log the error for this URL and continue to the next URL
|
// Log the error for this URL and continue to the next URL
|
||||||
console.log(`Error fetching data from ${apiUrl}: ${err.message}`);
|
console.log(`Error fetching data from ${apiUrl}: ${err.message}`);
|
||||||
errors.push(err.message);
|
errors.push(err.message);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue