diff --git a/scraper/scrap.ts b/scraper/scrap.ts index 1251ea1..dc5f4df 100644 --- a/scraper/scrap.ts +++ b/scraper/scrap.ts @@ -37,9 +37,8 @@ export async function parseWarc(path: string) { errors: { error: any; warcRecordId: string; path: string }[]; } = { done: 0, errors: [] }; - const warc = Bun.spawn(["zstd", "-do", "/dev/stdout", path], { - stderr: "ignore", - }).stdout; + const proc = Bun.spawn(["zstdcat", "-d", path], {}); + const warc = proc.stdout; // TODO: tirar error si falla zstd const parser = new WARCParser(warc); @@ -99,5 +98,9 @@ export async function parseWarc(path: string) { } } + if ((await proc.exited) !== 0) { + throw new Error("zstd tirĂ³ un error"); + } + return progress; }