diff --git a/.gitignore b/.gitignore index de4f868..61c4b63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Logs .DS*Store +.idea logs *.log npm-debug.log\_ diff --git a/src/archive.ts b/src/archive.ts index d25c120..d5ff06d 100644 --- a/src/archive.ts +++ b/src/archive.ts @@ -19,6 +19,17 @@ const SELECTORS = { }; const PHASES = [1, 2, 3]; +/** + * Récupère l'URL de l'archive. Ajoute le paramètre nopagination pour éviter la pagination. + * @param baseUrl + * @param pathName + */ +async function getArchiveUrl(baseUrl: string, pathName: string = ''): Promise { + const url = new URL(`${baseUrl}/${pathName}`); + // Ajouter le paramètre nopagination + url.searchParams.append('nopagination', 'true'); + return url.toString(); +} async function gotoWithRetry(page: Page, url: string, maxAttempts = 5): Promise { for (let attempt = 1; attempt <= maxAttempts; attempt++) { @@ -72,7 +83,8 @@ async function archivePage(dirPath: string, page: Page, ressources: Record