v1.5.9 (Actuel)
This commit is contained in:
+5
-7
@@ -30,13 +30,11 @@ function deduplicateByTitle(results: SearchResult[]): SearchResult[] {
|
||||
});
|
||||
}
|
||||
|
||||
export class ZTAPI implements ISource {
|
||||
export class ZoneTelechargementAPI implements ISource {
|
||||
name = 'zt';
|
||||
displayName = 'ZT';
|
||||
private baseUrl: string | undefined;
|
||||
|
||||
constructor(baseUrl?: string) {
|
||||
this.baseUrl = baseUrl;
|
||||
displayName = 'Zone-Téléchargement';
|
||||
get baseUrl() {
|
||||
return CONFIG.ZT_URL?.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
async healthCheck(): Promise<boolean> {
|
||||
@@ -161,4 +159,4 @@ export class ZTAPI implements ISource {
|
||||
}
|
||||
|
||||
// ── Auto-registration ──
|
||||
sourceRegistry.register(new ZTAPI(CONFIG.ZT_URL));
|
||||
sourceRegistry.register(new ZoneTelechargementAPI());
|
||||
|
||||
@@ -32,7 +32,13 @@ export function parseSearchHTML(html: string, baseUrl: string | undefined): Sear
|
||||
type = 'anime';
|
||||
}
|
||||
|
||||
results.push({ title, image, hrefPath: href, year: null, type, source: 'zt' });
|
||||
let year: string | null = null;
|
||||
const yearMatch = title.match(/\(\s*(\d{4})\s*\)/) || href.match(/-(\d{4})-/);
|
||||
if (yearMatch) {
|
||||
year = yearMatch[1];
|
||||
}
|
||||
|
||||
results.push({ title, image, hrefPath: href, year, type, source: 'zt' });
|
||||
}
|
||||
|
||||
return results;
|
||||
@@ -80,7 +86,7 @@ export function parseContentHTML(html: string): ContentLinks {
|
||||
const cleanedLabel = label.replace(sizeRegex, "").trim();
|
||||
|
||||
// On n'utilise le label comme "épisode" que si c'est un vrai nom de fichier/épisode (pas juste "Télécharger")
|
||||
const isGenericLabel = /^(t\u00e9l\u00e9charger|download|cliquez ici|lien|turbobit|1fichier|uptobox|rapidgator|nitroflare|send.now)/i.test(cleanedLabel);
|
||||
const isGenericLabel = /^(t\u00e9l\u00e9charger|download|cliquez ici|lien|turbobit|1fichier|rapidgator|nitroflare|send.now)/i.test(cleanedLabel);
|
||||
let episode = (!isGenericLabel && cleanedLabel.length > 3) ? cleanedLabel : undefined;
|
||||
|
||||
// SI le label est générique, on cherche un texte juste avant (ex: "Episode 1")
|
||||
|
||||
Reference in New Issue
Block a user