From 4ae88c3c80ee12c9ae3912066a1533467df7624f Mon Sep 17 00:00:00 2001 From: Ritesh Ghosh Date: Tue, 6 Aug 2024 20:46:08 +0530 Subject: [PATCH] fix(animeEpisodeSrcs): fix bug where internal fn would call outer wrapper --- src/scrapers/animeEpisodeSrcs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scrapers/animeEpisodeSrcs.ts b/src/scrapers/animeEpisodeSrcs.ts index 5820685..22a0b3d 100644 --- a/src/scrapers/animeEpisodeSrcs.ts +++ b/src/scrapers/animeEpisodeSrcs.ts @@ -113,7 +113,7 @@ async function _getAnimeEpisodeSources( } = await client.get(`${SRC_AJAX_URL}/v2/episode/sources?id=${serverId}`); console.log("THE LINK: ", link); - return await getAnimeEpisodeSources(link, server); + return await _getAnimeEpisodeSources(link, server); } catch (err: any) { throw AniwatchError.wrapError(err, getAnimeEpisodeSources.name); } @@ -140,7 +140,7 @@ export async function getAnimeEpisodeSources( ScrapedAnimeEpisodesSources & { anilistID: AnilistID; malID: MalID } > { try { - if (episodeId.trim() === "" || episodeId.indexOf("?ep=") === -1) { + if (episodeId === "" || episodeId.indexOf("?ep=") === -1) { throw new AniwatchError( "invalid anime episode id", getAnimeEpisodeSources.name