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
602 stars 63 forks source link

Can we use sessionData in CLI? #54

Closed DeployThemAll closed 6 months ago

DeployThemAll commented 1 year ago

I'm using Cli with cookies

I need to include sessionData and also open the browser in stealth mode.

I use stealth mode plugin with puppeteer along with adding sessionData and works fine. I just can't include them while using SingleFile Cli?

any idea on how to use it?

gildas-lormeau commented 12 months ago

Sorry for the late answer, what do you mean by sessionData?

DeployThemAll commented 12 months ago

Sorry for the late answer, what do you mean by sessionData?

Things like Local Storage/Session Storage

I'm trying to download a page, but everytime I try to access it. I got hit by checking connection captacha

I managed to bypass it when using cookies with puppeteer and stealth plugin and I can only do actions related to puppeteer

but I can't make singlefile cli to download the page because I get hit by connection captcha

I'm assuming that I need the same data session along with cookies (after I login manually and save them.) to be used with the cli

I hope I was able to explain it better.

gildas-lormeau commented 12 months ago

You could run a userscript in order to populate the storage before capturing the page, see https://github.com/gildas-lormeau/SingleFile/wiki/How-to-execute-a-user-script-before-a-page-is-saved.

gildas-lormeau commented 12 months ago

I'm moving the issue in the CLI repository and converting it into a post in the "Discussions" tab.

gildas-lormeau commented 12 months ago

Well, for some reason, I cannot convert the issue.

DeployThemAll commented 11 months ago

can you try downloading this page in cli and let me know the result

https://cxl.com/blog/which-color-converts-the-best/

You may have a better option

gildas-lormeau commented 6 months ago

You can now pass easily the path to your user data folder with the switch --browser-arg, e.g. ./single-file https://www.example.com --browser-arg="--user-data-dir=/Users/<username>/Library/Application Support/Google/Chrome" (on macOS).