Skip to content

Instantly share code, notes, and snippets.

@geopelia
Created October 26, 2016 20:41
Show Gist options
  • Save geopelia/16fd980da1ca9cef0809abd4316863fb to your computer and use it in GitHub Desktop.
Save geopelia/16fd980da1ca9cef0809abd4316863fb to your computer and use it in GitHub Desktop.
download file after login in using curl
curl 'http://example.com/forum/login.php' -H 'Host: example.com' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://example.com/forum/login.php' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' --data 'name=user&pass=passs&back=%2F' -c "cookies.txt"
curl -O 'http://example.com/download/user/d61bdf7e2e/11724.mp3' -H 'Host: example.com' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://example.com/amusic/' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' --data '' -b cookies.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment