Resume a download behind a Login Form

Sometimes, when you’re downloading a large file from a NAS or website which requires you to login via an HTML form, you need to retrieve the website cookie into curl before resuming the download.

curl -c '/tmp/cookie' -d 'username=USERNAME_HERE&passwd=PASSWORD_HERE' http://full.url.to/login_form.cgi

curl -b '/tmp/cookie' -o partial-downloaded-file.zip -C - http://full.url.to/original_file.zip

You’ll have to replace “username” and “passwd” with whatever the login form HTML names are.

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.