mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-05 22:15:36 +05:00
feat: rewrite player parsing to js and add it them to repo
This commit is contained in:
parent
743f756920
commit
990b3c1736
9 changed files with 1275 additions and 34 deletions
17
player-parsers/libria.ts
Normal file
17
player-parsers/libria.ts
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue