usar curl lol

This commit is contained in:
Cat /dev/Nulo 2024-08-24 22:57:24 -03:00
parent 665110a2d6
commit 4d87fdbf25

View file

@ -122,14 +122,8 @@ for (const resource of datasetInfo.result.resources) {
const dir = await mkdtemp("/tmp/sepa-precios-archiver-repackage-"); const dir = await mkdtemp("/tmp/sepa-precios-archiver-repackage-");
console.info(dir); console.info(dir);
try { try {
const response = await fetch(resource.url);
if (!checkRes(response)) continue;
// const response = Bun.file(
// `/Users/diablo/Downloads/dump precios justos/${basename(resource.url)}`,
// );
const zip = join(dir, "zip"); const zip = join(dir, "zip");
await write(zip, response); await $`curl -L -o ${zip} ${resource.url}`;
await $`unzip ${zip} -d ${dir}`; await $`unzip ${zip} -d ${dir}`;
await rm(zip); await rm(zip);