gildas-lormeau / single-file-cli

CLI tool for saving a faithful copy of a complete web page in a single HTML file (based on SingleFile)
GNU Affero General Public License v3.0
539 stars 57 forks source link

It's just a long string of numbers #74

Closed Explosion-Scratch closed 3 months ago

Explosion-Scratch commented 3 months ago

When I run something like singlefile --compress-content --compress-HTML --compress-CSS --self-extracting-archive true https://example.com I just get a HTML file with tons of numbers separated by commas

Example Domain (3_28_2024 10_44_52 AM).u.zip.html.txt

(I've renamed the file to include .txt to get GitHub to upload it)

Explosion-Scratch commented 3 months ago

It seems like it's writing the Buffer as a string somehow, because writeFileSync("output.html", Buffer(readFileSync("input.html", "utf-8").split(',').map(i => parseInt(i, 10))) generates something that seems like what it should generate

(I then ran into syntax errors when opening the file [object Object] so not sure if that's another bug or the way I decoded it)

gildas-lormeau commented 3 months ago

Thank you, I was able to reproduce and fix the two bugs. The fix is available in the version 2.0.15 I've just published.

Explosion-Scratch commented 3 months ago

Awesome, tysm!