fix: update anify url
This commit is contained in:
@@ -15,7 +15,7 @@ export async function getEpisodesFromAnify(
|
|||||||
const abortController = new AbortController();
|
const abortController = new AbortController();
|
||||||
try {
|
try {
|
||||||
response = await promiseTimeout(
|
response = await promiseTimeout(
|
||||||
fetch(`https://api.anify.tv/episodes/${aniListId}`, {
|
fetch(`https://anify.eltik.cc/episodes/${aniListId}`, {
|
||||||
signal: abortController.signal,
|
signal: abortController.signal,
|
||||||
}).then((res) => res.json<AnifyEpisodesResponse[]>()),
|
}).then((res) => res.json<AnifyEpisodesResponse[]>()),
|
||||||
30 * 1000,
|
30 * 1000,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export async function getSourcesFromAnify(
|
|||||||
watchId: string,
|
watchId: string,
|
||||||
aniListId: number,
|
aniListId: number,
|
||||||
): Promise<FetchUrlResponse | null> {
|
): Promise<FetchUrlResponse | null> {
|
||||||
const response = await fetch("https://api.anify.tv/sources", {
|
const response = await fetch("https://anify.eltik.cc/sources", {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
watchId,
|
watchId,
|
||||||
providerId: provider,
|
providerId: provider,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ type AnifyInformation = {
|
|||||||
function fetchMissingInformationFromAnify(
|
function fetchMissingInformationFromAnify(
|
||||||
aniListId: number,
|
aniListId: number,
|
||||||
): Promise<AnifyInformation> {
|
): Promise<AnifyInformation> {
|
||||||
return fetch(`https://api.anify.tv/info?id=${aniListId}`)
|
return fetch(`https://anify.eltik.cc/info?id=${aniListId}`)
|
||||||
.then((res) => res.json() as Promise<AnifyInformation>)
|
.then((res) => res.json() as Promise<AnifyInformation>)
|
||||||
.then(({ bannerImage, countryOfOrigin }) => ({
|
.then(({ bannerImage, countryOfOrigin }) => ({
|
||||||
bannerImage,
|
bannerImage,
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
|
|
||||||
export function getAnifyEpisodes() {
|
export function getAnifyEpisodes() {
|
||||||
return http.get("https://api.anify.tv/episodes/:aniListId", ({ params }) => {
|
return http.get(
|
||||||
|
"https://anify.eltik.cc/episodes/:aniListId",
|
||||||
|
({ params }) => {
|
||||||
const aniListId = Number(params["aniListId"]);
|
const aniListId = Number(params["aniListId"]);
|
||||||
if (aniListId === 3 || aniListId === 4 || aniListId < 0) {
|
if (aniListId === 3 || aniListId === 4 || aniListId < 0) {
|
||||||
return HttpResponse.json([]);
|
return HttpResponse.json([]);
|
||||||
@@ -146,5 +148,6 @@ export function getAnifyEpisodes() {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
|
|
||||||
export function getAnifySources() {
|
export function getAnifySources() {
|
||||||
return http.post("https://api.anify.tv/sources", async ({ request }) => {
|
return http.post("https://anify.eltik.cc/sources", async ({ request }) => {
|
||||||
const { id: aniListId } = await request.json();
|
const { id: aniListId } = await request.json();
|
||||||
if (aniListId < 0) {
|
if (aniListId < 0) {
|
||||||
return HttpResponse.json({ sources: [] });
|
return HttpResponse.json({ sources: [] });
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
|
|
||||||
export function getAnifyTitle() {
|
export function getAnifyTitle() {
|
||||||
return http.get(`https://api.anify.tv/info`, ({ request }) => {
|
return http.get(`https://anify.eltik.cc/info`, ({ request }) => {
|
||||||
// Construct a URL instance out of the intercepted request.
|
// Construct a URL instance out of the intercepted request.
|
||||||
const url = new URL(request.url);
|
const url = new URL(request.url);
|
||||||
const id = url.searchParams.get("id");
|
const id = url.searchParams.get("id");
|
||||||
|
|||||||
Reference in New Issue
Block a user