diff --git a/scraper/scrap.ts b/scraper/scrap.ts index 4d9ae9b..3e76cd6 100644 --- a/scraper/scrap.ts +++ b/scraper/scrap.ts @@ -33,6 +33,7 @@ export async function downloadList(path: string) { async (urlS) => { let res: ScrapResult = { type: "skipped" }; for (let attempts = 0; attempts < 3; attempts++) { + if (attempts !== 0) await wait(1500); res = await scrap(urlS); if (res.type === "done" || res.type === "skipped") { break; @@ -101,3 +102,7 @@ async function scrap(urlS: string): Promise { }; } } + +function wait(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +}