v1.5.9 (Actuel)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Appels réseau pour zt.news.
|
||||
* Appels réseau pour zone-telechargement.news.
|
||||
* Pas de challenge CF actif, fetch direct simple.
|
||||
*/
|
||||
|
||||
|
||||
@@ -29,12 +29,10 @@ function deduplicateByTitle(results: SearchResult[]): SearchResult[] {
|
||||
}
|
||||
|
||||
export class ZtTeamAPI implements ISource {
|
||||
name = 'ztteam';
|
||||
displayName = 'ZT (Team)';
|
||||
private baseUrl: string | undefined;
|
||||
|
||||
constructor(baseUrl?: string) {
|
||||
this.baseUrl = baseUrl?.replace(/\/$/, '');
|
||||
name = 'ztnews';
|
||||
displayName = 'Zone-Téléchargement (Team)';
|
||||
get baseUrl() {
|
||||
return CONFIG.ZTTEAM_URL?.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
async healthCheck(): Promise<boolean> {
|
||||
@@ -132,4 +130,4 @@ export class ZtTeamAPI implements ISource {
|
||||
}
|
||||
}
|
||||
|
||||
sourceRegistry.register(new ZtTeamAPI(CONFIG.ZTTEAM_URL));
|
||||
sourceRegistry.register(new ZtTeamAPI());
|
||||
|
||||
@@ -69,9 +69,15 @@ export function parseListingHTML(html: string, baseUrl: string): SearchResult[]
|
||||
const title = titleMatch[2]!.trim();
|
||||
const imgMatch = block.match(/<img class="mainimg"[^>]*src="([^"]+)"/);
|
||||
const image = imgMatch ? absUrl(imgMatch[1]!, baseUrl) : null;
|
||||
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,
|
||||
year: null,
|
||||
year,
|
||||
image,
|
||||
hrefPath: href,
|
||||
type: detectType(titleMatch[1]!),
|
||||
|
||||
Reference in New Issue
Block a user