Last active
April 4, 2018 11:54
-
-
Save timm0e/d2bdda5628b171ca878ae1923cd7178e to your computer and use it in GitHub Desktop.
Download large files (skipping the virus check) from Google Drive via curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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