From d69112059a99356d910924a2a40161047e2e8214 Mon Sep 17 00:00:00 2001 From: MrGus Date: Fri, 26 Dec 2025 20:35:30 +0100 Subject: [PATCH] Update anime/anicrush/source.js --- anime/anicrush/source.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/anime/anicrush/source.js b/anime/anicrush/source.js index 3f967ec..5663f7b 100644 --- a/anime/anicrush/source.js +++ b/anime/anicrush/source.js @@ -1,7 +1,7 @@ class AniCrush { constructor() { this.type = "anime-streaming"; - this.version = "1.0.0"; + this.version = "1.0.1"; this.baseUrl = "https://anicrush.to"; this.apiBase = "https://api.anicrush.to"; } @@ -68,8 +68,18 @@ class AniCrush { return q || {}; } + _stripYearHints(raw) { + const s = this._safeStr(raw).trim(); + if (!s) return ""; + return s + .replace(/\((?:19|20)\d{2}\)/g, " ") + .replace(/\b(?:19|20)\d{2}\b/g, " ") + .replace(/\s+/g, " ") + .trim(); + } + _normalize(title) { - return (this._safeStr(title)) + return (this._safeStr(this._stripYearHints(title))) .toLowerCase() .replace(/(season|cour|part)/g, "") .replace(/\d+(st|nd|rd|th)/g, (m) => m.replace(/st|nd|rd|th/, "")) @@ -78,7 +88,7 @@ class AniCrush { } _normalizeTitle(title) { - return (this._safeStr(title)) + return (this._safeStr(this._stripYearHints(title))) .toLowerCase() .replace(/(season|cour|part|uncensored)/g, "") .replace(/\d+(st|nd|rd|th)/g, (m) => m.replace(/st|nd|rd|th/, ""))