Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1584

Help: Rainmeter Skins • Re: How to download html with curl or wget: JavaScript login

$
0
0
Note: Using "Remember me" at login is not my target - this saves a cookie and then I don't need to enter my login credentials for a few weeks, but my multiple attempts to pass the extracted cookie to curl/wget have failed, so now I'm hoping to go the "simple way" with the above idea.
Well, in some cases, you do need cookies, or at least some request headers to actually login. Didn't manage to login with just the username and the password on this forum by using either CURL or the PowerShell script recommended by SilverAzide above, but once I did login in the browser, I could use the Developer Tools > Network Tab in Chrome to identify most of the request headers to use with a CURL command like this in CMD and save the result to a file:

Code:

curl --ssl-no-revoke -u "UserName":"Password" -o "Partition:/Path/File.html" "https://forum.rainmeter.net/viewforum.php?f=2" -H "accept: ..." -H "accept-language: ..." -H "cache-control: ..." -H "content-type: application/x-www-form-urlencoded" -H "cookie: ..." -H "origin: ..." -H "priority: ..." -H "referer: ..." -H "sec-ch-ua: ..." -H "sec-ch-ua-mobile: ..." -H "sec-ch-ua-platform: ..." -H "sec-fetch-dest: ..." -H "sec-fetch-mode: ..." -H "sec-fetch-site: ..." -H "sec-fetch-user: ..." -H "upgrade-insecure-requests: ..." -H "user-agent: ..."
The above works even without an username and password, once you're already logged in, and the style is a bit less secure, but it does the job - not sure if it will for Javascript heavy sites though. I imagine that SilverAzide's suggestion will also work in this case, once the required headers are added to the linked PS script.

Obviously, in the case of your site, some thing might differ from this basic test.

P.S. In the case of inner quotes, change them to apostrophes.

References:
- https://curl.se/docs/manpage.html
- https://curl.se/docs/http-cookies.html
- https://stackoverflow.com/questions/54938026/curl-unknown-error-0x80092012-the-revocation-function-was-unable-to-check-r
- https://stackoverflow.com/questions/2594880/using-curl-with-a-username-and-password
- https://stackoverflow.com/questions/34231334/windows-file-path-in-curl-commands

Statistics: Posted by Yincognito — Yesterday, 6:14 pm



Viewing all articles
Browse latest Browse all 1584

Trending Articles