Created
May 15, 2019 15:36
-
-
Save hsfzxjy/d706efadd769a313bc60e9a6498f1aad to your computer and use it in GitHub Desktop.
Download large file from google-drive using terminal only.
This file contains 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
# Usage: gdl <URL> <OUTPUT> | |
function gdl() { | |
URL=$1 | |
tmp_file=$(mktemp) | |
code=$(wget --save-cookies $tmp_file --keep-session-cookies --no-check-certificate $URL -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1/p') | |
echo $code | |
URL+="&confirm=$code" | |
wget --load-cookies $tmp_file $URL -O $2 | |
rm $tmp_file | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment