Initial commit (v1.5.9)

This commit is contained in:
2026-09-15 21:45:47 +02:00
commit b8d3dd52ec
89 changed files with 13429 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
/**
* Appels réseau pour zone-telechargement.news.
* Pas de challenge CF actif, fetch direct simple.
*/
const TIMEOUT = 20_000;
const UA = 'Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0';
async function ztnGet(url: string): Promise<string> {
const res = await fetch(url, {
headers: {
'User-Agent': UA,
'Accept': 'text/html,application/xhtml+xml,*/*;q=0.8',
'Accept-Language': 'fr-FR,fr;q=0.9,en;q=0.8',
},
redirect: 'follow',
signal: AbortSignal.timeout(TIMEOUT),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.text();
}
export async function fetchSearch(baseUrl: string, query: string): Promise<string> {
return ztnGet(`${baseUrl}/?p=films&search=${encodeURIComponent(query)}`);
}
/**
* News n'a pas vraiment de page "nouveautés" séparée — la home expose déjà
* une grille de blocs cover_global avec les derniers films/séries.
*/
export async function fetchTrending(baseUrl: string, type: 'films' | 'series'): Promise<string> {
return ztnGet(`${baseUrl}/?p=${type}`);
}
export async function fetchPage(pageUrl: string): Promise<string> {
return ztnGet(pageUrl);
}