Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


NPCtom

430 posts

Ultimate Geek


#250610 18-May-2019 14:27
Send private message

I am using curl to download thousands of avatars, but unfortunately the website's images are protected by login credentials (If you go to an image URL and are not logged in you get a default avatar). I have the ability to login but cannot find a method to load those credentials into curl. Would there be a way to use my cookies file to bypass this protection?

 

Curl Command:

 

curl 'https://stratus.pnbhs.school.nz/pluginfile.php/[42000-45000]/user/icon/pnbhs/f2' -o '#1'.jpg

 

 






Create new topic
SirHumphreyAppleby
2844 posts

Uber Geek


  #2240553 18-May-2019 14:37
Send private message

I've not done this with cURL (I used Wget in the past for similar tasks), but it appears you can use either -u username:password or the usual URL syntax, https://username:password@host:port/path. If the site isn't using standard HTTP credentials, then you will probably need to add headers. The exact requirements will be site dependant.

 

 




NPCtom

430 posts

Ultimate Geek


  #2240554 18-May-2019 14:39
Send private message

SirHumphreyAppleby:

 

I've not done this with cURL (I used Wget in the past for similar tasks), but it appears you can use either -u username:password or the usual URL syntax, https://username:password@host:port/path.

 

 

 

 

I did try using wget using -u but they seem to use Microsoft account integration to login and am unable to get that to work, thats why I thought loading the cookies file into the curl command would bypass that.






SirHumphreyAppleby
2844 posts

Uber Geek


  #2240555 18-May-2019 14:41
Send private message

NPCtom:

 

I did try using wget using -u but they seem to use Microsoft account integration to login and am unable to get that to work, thats why I thought loading the cookies file into the curl command would bypass that.

 

 

Sorry, I missed that. I'm not aware of any integration. In the past I've just done a copy and paste and reused browser cookies.




NPCtom

430 posts

Ultimate Geek


  #2240590 18-May-2019 16:35
Send private message

Found it!

 

 

 

I used my browser's cookies as a token to download the images. All I had to do was download my browser's cookies for that site and execute the command

 

curl --cookie cookies.txt 'https://stratus.pnbhs.school.nz/pluginfile.php/[42000-45000]/user/icon/pnbhs/f2' -o '#1'.jpg

 

 

 

Thanks for the help Appleby.






Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.