Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid or unsupported zip format. No END header found #17

Open
dlade96 opened this issue Sep 13, 2024 · 2 comments
Open

Invalid or unsupported zip format. No END header found #17

dlade96 opened this issue Sep 13, 2024 · 2 comments

Comments

@dlade96
Copy link

dlade96 commented Sep 13, 2024

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)

@rotragit
Copy link

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); }

@luigiguarnieri
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants