refactor/player-parser: change anilibria api url to current version

Translate error messages
This commit is contained in:
Kentai Radiquum 2025-07-09 15:27:13 +05:00
parent 144ef94f88
commit 4701f6f62e
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
3 changed files with 108 additions and 45 deletions

View file

@ -3,7 +3,7 @@ import { asJSON, randomUA } from "./shared";
export async function getSibnetURL(req, res, url: string) {
if (!url.includes("sibnet")) {
asJSON(req, res, { message: "Wrong url provided for player sibnet" }, 400);
asJSON(req, res, { message: "SIBNET: Неправильная ссылка на плеер" }, 400);
return
}
@ -15,7 +15,7 @@ export async function getSibnetURL(req, res, url: string) {
},
});
if (!pageRes.ok) {
asJSON(req, res, { message: `SIBNET:${pageRes.status}: failed to load page` }, 500)
asJSON(req, res, { message: `SIBNET: Не удалось загрузить страницу с плеером` }, 500)
return
}
const pageData = await pageRes.text();
@ -23,7 +23,7 @@ export async function getSibnetURL(req, res, url: string) {
const videoMatch = videoRe.exec(pageData);
if (!videoMatch || videoMatch.length == 0) {
asJSON(req, res, { message: `SIBNET: failed to find data to parse` }, 500)
asJSON(req, res, { message: `SIBNET: Не удалось найти данные эпизода` }, 500)
return
}
@ -42,7 +42,7 @@ export async function getSibnetURL(req, res, url: string) {
);
if (!actualVideoRes.headers.get("location")) {
asJSON(req, res, { message: `SIBNET: failed to get video link` }, 500)
asJSON(req, res, { message: `SIBNET: Не удалось получить прямую ссылку` }, 500)
return
}