From 021af8f19dd100b64409a3a62d6215866feaf27d Mon Sep 17 00:00:00 2001 From: capitanwesler Date: Mon, 5 Apr 2021 09:28:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=BE=20Re-adapting=20jkanime=20servers?= =?UTF-8?q?=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/AnimeController.ts | 1 - src/utils/util.ts | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/controllers/AnimeController.ts b/src/controllers/AnimeController.ts index 3bf0190..20657b5 100644 --- a/src/controllers/AnimeController.ts +++ b/src/controllers/AnimeController.ts @@ -646,7 +646,6 @@ export default class AnimeController { return res.status(200).json(resultRedis); } else { - console.log(id); if (isNaN(parseInt(id.split('/')[0]))) { if (id.split('/')[0] === 'ver') { data = await videoServersMonosChinos(id); diff --git a/src/utils/util.ts b/src/utils/util.ts index 106f1f3..b04f991 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -488,7 +488,7 @@ export const jkanimeInfo = async (id: string | undefined) => { return err; } - countEpisodes = $('div.navigation a') + countEpisodes = $('div.anime__pagination a') .map((index: number, element: cheerio.Element) => { return $(element).text(); }) @@ -701,12 +701,14 @@ export const videoServersJK = async (id: string) => { return err; } - const serverNames: string[] = $('div#reproductor-box li') + const serverNames: string[] = $('div.bg-servers a') .map((index: number, element: cheerio.Element) => { - return $(element).find('a').text(); + return $(element).text(); }) .get(); + console.log(serverNames); + $('script').each((index: number, element: cheerio.Element) => { if ($(element).html()!.includes('var video = [];')) { script = $(element).html();