Skip to content

Instantly share code, notes, and snippets.

@suiluj
Last active April 18, 2023 13:25
Show Gist options
  • Save suiluj/41e06d6e5b6d5266dc7b0b10ae287033 to your computer and use it in GitHub Desktop.
Save suiluj/41e06d6e5b6d5266dc7b0b10ae287033 to your computer and use it in GitHub Desktop.
download token and header protected file via command line in different terminal but easy direct copy curl command from browser

How to download password/header/token protected file via command line

  • open dev tool network tab in chrome
  • just click on download link and wait until file dialog opens
  • right click on file download network entry
  • copy as curl command (bash) (for linux; and cmd for windows i guess)
  • open terminal
  • cd into correct folder
  • past copied curl command
  • add -L (just in case there is a redirect (in general I know this trick from a youtube video and someone used a hugging face model download where redirected is needed; explain shell curl -L)
  • -o <filename>
  • press enter and wait for download to finish
  • in case of binary do not forget to chmod +x <filename>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment