Open dlade96 opened 2 months ago
add try/catch blocks:
try {
const zip = new AdmZip(Buffer.from(res));
await zip.extractAllTo(`temp/build`);
}
catch (error) {
console.error(error);
}
and
try {
const files = fsExtra.readdirSync(base);
for (const file of files) {
if (file.includes(".pdf")) {
await merger.add(`${base}/${file}`);
}
}
} catch (error) { console.error(error); }
Downloading pages... /Volumes/WD_Black/luigiguarnieri/hub_young/node_modules/adm-zip/zipFile.js:102 if (!~endOffset) throw new Error(Utils.Errors.INVALID_FORMAT); ^
Error: Invalid or unsupported zip format. No END header found at readMainHeader (/Volumes/WD_Black/luigiguarnieri/hub_young/node_modules/adm-zip/zipFile.js:102:32) at new module.exports (/Volumes/WD_Black/luigiguarnieri/hub_young/node_modules/adm-zip/zipFile.js:20:9) at new module.exports (/Volumes/WD_Black/luigiguarnieri/hub_young/node_modules/adm-zip/adm-zip.js:62:18) at file:///Volumes/WD_Black/luigiguarnieri/hub_young/index.js:134:21 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v20.18.0
at readMainHeader (F:\Download\hub-young-downloader-main\hub-young-downloader-main\node_modules\adm-zip\zipFile.js:102:32) at new module.exports (F:\Download\hub-young-downloader-main\hub-young-downloader-main\node_modules\adm-zip\zipFile.js:20:9) at new module.exports (F:\Download\hub-young-downloader-main\hub-young-downloader-main\node_modules\adm-zip\adm-zip.js:62:18) at file:///F:/Download/hub-young-downloader-main/hub-young-downloader-main/index.js:134:21 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)