Skip to content

Instantly share code, notes, and snippets.

@timm0e
Last active April 4, 2018 11:54
Show Gist options
  • Save timm0e/d2bdda5628b171ca878ae1923cd7178e to your computer and use it in GitHub Desktop.
Save timm0e/d2bdda5628b171ca878ae1923cd7178e to your computer and use it in GitHub Desktop.
Download large files (skipping the virus check) from Google Drive via curl
#!/bin/bash
# Usage: ./gdrive_curl.sh <your link to file over 40 MB> | xargs curl -youradditionalcurlarguments
(echo "Generating curl arguments..." >&2)
regex='jfk-button-action" href="([^"]*)">'
if [[ $(curl -s -c /tmp/cookies.txt $1) =~ $regex ]]; then echo -L -b /tmp/cookies.txt \'https://drive.google.com${BASH_REMATCH[1]//amp;/}\';fi
(echo "Done!" >&2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment