Update anime/anicrush/source.js

This commit is contained in:
2025-12-26 20:35:30 +01:00
parent 50f2635cc7
commit d69112059a

View File

@@ -1,7 +1,7 @@
class AniCrush { class AniCrush {
constructor() { constructor() {
this.type = "anime-streaming"; this.type = "anime-streaming";
this.version = "1.0.0"; this.version = "1.0.1";
this.baseUrl = "https://anicrush.to"; this.baseUrl = "https://anicrush.to";
this.apiBase = "https://api.anicrush.to"; this.apiBase = "https://api.anicrush.to";
} }
@@ -68,8 +68,18 @@ class AniCrush {
return q || {}; 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) { _normalize(title) {
return (this._safeStr(title)) return (this._safeStr(this._stripYearHints(title)))
.toLowerCase() .toLowerCase()
.replace(/(season|cour|part)/g, "") .replace(/(season|cour|part)/g, "")
.replace(/\d+(st|nd|rd|th)/g, (m) => m.replace(/st|nd|rd|th/, "")) .replace(/\d+(st|nd|rd|th)/g, (m) => m.replace(/st|nd|rd|th/, ""))
@@ -78,7 +88,7 @@ class AniCrush {
} }
_normalizeTitle(title) { _normalizeTitle(title) {
return (this._safeStr(title)) return (this._safeStr(this._stripYearHints(title)))
.toLowerCase() .toLowerCase()
.replace(/(season|cour|part|uncensored)/g, "") .replace(/(season|cour|part|uncensored)/g, "")
.replace(/\d+(st|nd|rd|th)/g, (m) => m.replace(/st|nd|rd|th/, "")) .replace(/\d+(st|nd|rd|th)/g, (m) => m.replace(/st|nd|rd|th/, ""))