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/, ""))