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
540 stars 58 forks source link

Singlefile CLI fails to clone website on first run #41

Closed assume-breach closed 2 months ago

assume-breach commented 2 years ago

I am running singlefile on a raspberry pi 3B+ running Chromium. (I know that SingleFile is officially supported on a Raspberry Pi)

I am using this command:

./single-file --browser-executable-path=chromium-browser https://yahoo.com .

When I boot my Pi and run this command, it just hangs. However, if I interrupt it and then rerun the command, the webpage downloads.

Expected behavior Downloaded website on first run of SingleFile.

Environment Raspberry Pi 3B+ Raspbian 64 bit

Thanks for you help!

EDIT: This can be closed. I figured out how to get this working on a raspberry pi if you want to use SinglFile cli in a script. You can run /usr/bin/chromium-browser --no-sandbox 2>/dev/null first as root. This will suppress the error but launch a browser instance. You can then run your SingleFile command without having to interrupt the first run.

Example:

!/bin/bash

/usr/bin/chromium-browser --no-sandbox 2>/dev/null runuser -u pi -- /single-file --browser-executable-path=chromium-browser https://yahoo.com .

gildas-lormeau commented 2 years ago

Thank you for the update. I guess passing --browser-args "[\"--no-sandbox\"]" to single-file instead of launching chrome should work as well.