feat: rewrite player parsing to js and add it them to repo

This commit is contained in:
Kentai Radiquum 2025-05-29 22:36:44 +05:00
parent 743f756920
commit 990b3c1736
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
9 changed files with 1275 additions and 34 deletions

17
player-parsers/libria.ts Normal file
View file

@ -0,0 +1,17 @@
import { asJSON } from "./shared";
export async function getAnilibriaURL(res, url: string) {
if (!url.includes("anilibria")) {
asJSON(res, { message: "Wrong url provided for player libria" }, 400);
return
}
let apiRes = await fetch(url);
if (!apiRes.ok) {
asJSON(res, { message: "LIBRIA: failed to get api response" }, 500);
return
}
asJSON(res, await apiRes.json(), 200);
return
}