diff --git a/src/controllers/episodes/getByAniListId/anify.ts b/src/controllers/episodes/getByAniListId/anify.ts index c3cb387..3d25885 100644 --- a/src/controllers/episodes/getByAniListId/anify.ts +++ b/src/controllers/episodes/getByAniListId/anify.ts @@ -15,7 +15,7 @@ export async function getEpisodesFromAnify( const abortController = new AbortController(); try { response = await promiseTimeout( - fetch(`https://api.anify.tv/episodes/${aniListId}`, { + fetch(`https://anify.eltik.cc/episodes/${aniListId}`, { signal: abortController.signal, }).then((res) => res.json()), 30 * 1000, diff --git a/src/controllers/episodes/getEpisodeUrl/anify.ts b/src/controllers/episodes/getEpisodeUrl/anify.ts index 0040c54..2e24797 100644 --- a/src/controllers/episodes/getEpisodeUrl/anify.ts +++ b/src/controllers/episodes/getEpisodeUrl/anify.ts @@ -12,7 +12,7 @@ export async function getSourcesFromAnify( watchId: string, aniListId: number, ): Promise { - const response = await fetch("https://api.anify.tv/sources", { + const response = await fetch("https://anify.eltik.cc/sources", { body: JSON.stringify({ watchId, providerId: provider, diff --git a/src/controllers/title/amvstrm.ts b/src/controllers/title/amvstrm.ts index ddddb6a..d8eaed5 100644 --- a/src/controllers/title/amvstrm.ts +++ b/src/controllers/title/amvstrm.ts @@ -53,7 +53,7 @@ type AnifyInformation = { function fetchMissingInformationFromAnify( aniListId: number, ): Promise { - return fetch(`https://api.anify.tv/info?id=${aniListId}`) + return fetch(`https://anify.eltik.cc/info?id=${aniListId}`) .then((res) => res.json() as Promise) .then(({ bannerImage, countryOfOrigin }) => ({ bannerImage, diff --git a/src/mocks/anify/episodes.ts b/src/mocks/anify/episodes.ts index 000bfb7..6bfec47 100644 --- a/src/mocks/anify/episodes.ts +++ b/src/mocks/anify/episodes.ts @@ -1,150 +1,153 @@ import { HttpResponse, http } from "msw"; export function getAnifyEpisodes() { - return http.get("https://api.anify.tv/episodes/:aniListId", ({ params }) => { - const aniListId = Number(params["aniListId"]); - if (aniListId === 3 || aniListId === 4 || aniListId < 0) { - return HttpResponse.json([]); - } + return http.get( + "https://anify.eltik.cc/episodes/:aniListId", + ({ params }) => { + const aniListId = Number(params["aniListId"]); + if (aniListId === 3 || aniListId === 4 || aniListId < 0) { + return HttpResponse.json([]); + } - return HttpResponse.json([ - { - providerId: "zoro", - episodes: [ - { - id: "/watch/spy-classroom-season-2-18468?ep=103233", - isFiller: false, - number: 1, - title: "Mission: Forgetter I", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=103632", - isFiller: false, - number: 2, - title: "Mission: Forgetter II", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=104244", - isFiller: false, - number: 3, - title: "Mission: Forgetter III", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=104620", - isFiller: false, - number: 4, - title: "Mission: Forgetter IV", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=104844", - isFiller: false, - number: 5, - title: "File: Glint", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=105761", - isFiller: false, - number: 6, - title: "File: Dreamspeaker Thea", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=106135", - isFiller: false, - number: 7, - title: "File: Forgetter Annette", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=106518", - isFiller: false, - number: 8, - title: "Mission: Dreamspeaker I", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=106606", - isFiller: false, - number: 9, - title: "Mission: Dreamspeaker II", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=106981", - isFiller: false, - number: 10, - title: "Mission: Dreamspeaker III", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=107176", - isFiller: false, - number: 11, - title: "Mission: Dreamspeaker IV", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - { - id: "/watch/spy-classroom-season-2-18468?ep=107247", - isFiller: false, - number: 12, - title: "File: Flower Garden Lily", - img: null, - hasDub: false, - description: null, - rating: null, - updatedAt: 0, - }, - ], - }, - ]); - }); + return HttpResponse.json([ + { + providerId: "zoro", + episodes: [ + { + id: "/watch/spy-classroom-season-2-18468?ep=103233", + isFiller: false, + number: 1, + title: "Mission: Forgetter I", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=103632", + isFiller: false, + number: 2, + title: "Mission: Forgetter II", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=104244", + isFiller: false, + number: 3, + title: "Mission: Forgetter III", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=104620", + isFiller: false, + number: 4, + title: "Mission: Forgetter IV", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=104844", + isFiller: false, + number: 5, + title: "File: Glint", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=105761", + isFiller: false, + number: 6, + title: "File: Dreamspeaker Thea", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=106135", + isFiller: false, + number: 7, + title: "File: Forgetter Annette", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=106518", + isFiller: false, + number: 8, + title: "Mission: Dreamspeaker I", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=106606", + isFiller: false, + number: 9, + title: "Mission: Dreamspeaker II", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=106981", + isFiller: false, + number: 10, + title: "Mission: Dreamspeaker III", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=107176", + isFiller: false, + number: 11, + title: "Mission: Dreamspeaker IV", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + { + id: "/watch/spy-classroom-season-2-18468?ep=107247", + isFiller: false, + number: 12, + title: "File: Flower Garden Lily", + img: null, + hasDub: false, + description: null, + rating: null, + updatedAt: 0, + }, + ], + }, + ]); + }, + ); } diff --git a/src/mocks/anify/sources.ts b/src/mocks/anify/sources.ts index abf72bc..2d741a6 100644 --- a/src/mocks/anify/sources.ts +++ b/src/mocks/anify/sources.ts @@ -1,7 +1,7 @@ import { HttpResponse, http } from "msw"; 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(); if (aniListId < 0) { return HttpResponse.json({ sources: [] }); diff --git a/src/mocks/anify/title.ts b/src/mocks/anify/title.ts index 47e7cac..3532d77 100644 --- a/src/mocks/anify/title.ts +++ b/src/mocks/anify/title.ts @@ -1,7 +1,7 @@ import { HttpResponse, http } from "msw"; 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. const url = new URL(request.url); const id = url.searchParams.get("id");