wget and cookies

Penobscot

Dabbler
Joined
Nov 22, 2021
Messages
15
I'll throw this out there:

I frequently download software via the TN shell using wget. Some vendors require me to log on to access their files. I'd like to know if there's a way to log on from Firefox (or whatever) and save the cookies so that TN can use them? Or, better, log in via wget or curl and then download? The vendor I'm interested in at the moment is Dell. Thanks.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Looks like this Firefox extension will let you save the cookies:

...and then use the --load-cookies option for wget.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
I've used usernames & passwords with curl but had the security issue of it being in plain text. Their might be a better way today, have not looked at it in years. And of course, I no longer use that specific curl script anymore.
 

Penobscot

Dabbler
Joined
Nov 22, 2021
Messages
15
I got the Firefox extension, but no joy. If I ever resolve this then I'll update the thread.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
You could also just download it locally on Firefox and then move it to your NAS via rsync/SMB/NFS, etc.... It IS a NAS after all.
 

Penobscot

Dabbler
Joined
Nov 22, 2021
Messages
15
Yes, but the files can be 14GB and I would just as soon not have to do that.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
You could use curl instead and initiate the download through firefox. Open the "Developer Tools" and look at the download request and select the option "Copy as cURL". That should get all the necessary headers and payload.
 
Top