mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-05 05:55:36 +05:00
formatting
This commit is contained in:
parent
f2a5054f76
commit
7ce63e4fe5
1 changed files with 12 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { tryCatchPlayer, tryCatchAPI } from "#/api/utils";
|
import { tryCatchPlayer, tryCatchAPI } from "#/api/utils";
|
||||||
import { env } from 'next-runtime-env';
|
import { env } from "next-runtime-env";
|
||||||
|
|
||||||
export async function _fetchAPI(
|
export async function _fetchAPI(
|
||||||
url: string,
|
url: string,
|
||||||
|
@ -62,12 +62,11 @@ export async function _fetchPlayer(
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const _fetchKodikManifest = async (
|
export const _fetchKodikManifest = async (
|
||||||
url: string,
|
url: string,
|
||||||
setPlayerError: (state) => void
|
setPlayerError: (state) => void
|
||||||
) => {
|
) => {
|
||||||
const NEXT_PUBLIC_PLAYER_PARSER_URL = env("NEXT_PUBLIC_PLAYER_PARSER_URL")
|
const NEXT_PUBLIC_PLAYER_PARSER_URL = env("NEXT_PUBLIC_PLAYER_PARSER_URL");
|
||||||
if (!NEXT_PUBLIC_PLAYER_PARSER_URL) {
|
if (!NEXT_PUBLIC_PLAYER_PARSER_URL) {
|
||||||
setPlayerError({
|
setPlayerError({
|
||||||
message: "Плеер не настроен",
|
message: "Плеер не настроен",
|
||||||
|
@ -82,15 +81,15 @@ export const _fetchKodikManifest = async (
|
||||||
);
|
);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
let manifest: string = data.manifest
|
let manifest: string = data.manifest;
|
||||||
if (!manifest.startsWith("http")) {
|
if (!manifest.startsWith("http")) {
|
||||||
let file = new File([manifest], "manifest.m3u8", {
|
let file = new File([manifest], "manifest.m3u8", {
|
||||||
type: "application/x-mpegURL",
|
type: "application/x-mpegURL",
|
||||||
});
|
});
|
||||||
manifest = URL.createObjectURL(file);
|
manifest = URL.createObjectURL(file);
|
||||||
}
|
|
||||||
return { manifest, poster: data.poster };
|
|
||||||
}
|
}
|
||||||
|
return { manifest, poster: data.poster };
|
||||||
|
}
|
||||||
return { manifest: null, poster: null };
|
return { manifest: null, poster: null };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -98,7 +97,7 @@ export const _fetchAnilibriaManifest = async (
|
||||||
url: string,
|
url: string,
|
||||||
setPlayerError: (state) => void
|
setPlayerError: (state) => void
|
||||||
) => {
|
) => {
|
||||||
const NEXT_PUBLIC_PLAYER_PARSER_URL = env("NEXT_PUBLIC_PLAYER_PARSER_URL")
|
const NEXT_PUBLIC_PLAYER_PARSER_URL = env("NEXT_PUBLIC_PLAYER_PARSER_URL");
|
||||||
if (!NEXT_PUBLIC_PLAYER_PARSER_URL) {
|
if (!NEXT_PUBLIC_PLAYER_PARSER_URL) {
|
||||||
setPlayerError({
|
setPlayerError({
|
||||||
message: "Плеер не настроен",
|
message: "Плеер не настроен",
|
||||||
|
@ -126,7 +125,7 @@ export const _fetchSibnetManifest = async (
|
||||||
url: string,
|
url: string,
|
||||||
setPlayerError: (state) => void
|
setPlayerError: (state) => void
|
||||||
) => {
|
) => {
|
||||||
const NEXT_PUBLIC_PLAYER_PARSER_URL = env("NEXT_PUBLIC_PLAYER_PARSER_URL")
|
const NEXT_PUBLIC_PLAYER_PARSER_URL = env("NEXT_PUBLIC_PLAYER_PARSER_URL");
|
||||||
if (!NEXT_PUBLIC_PLAYER_PARSER_URL) {
|
if (!NEXT_PUBLIC_PLAYER_PARSER_URL) {
|
||||||
setPlayerError({
|
setPlayerError({
|
||||||
message: "Плеер не настроен",
|
message: "Плеер не настроен",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue