mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-05 22:15:36 +05:00
refactor/player-parser: change anilibria api url to current version
Translate error messages
This commit is contained in:
parent
144ef94f88
commit
4701f6f62e
3 changed files with 108 additions and 45 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue