Created
February 20, 2021 13:14
-
-
Save deeperlearner/375f37a51a0d5bc74b7c0836858a080f to your computer and use it in GitHub Desktop.
wgetgdrive.sh
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 | |
# Get file (>100MB) from Google Drive | |
# ./wgetgdrive.sh $1 $2 | |
ID=$1 | |
FILE_NAME=$2 | |
URL="https://docs.google.com/uc?export=download&id=$ID" | |
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate $URL -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$ID" -O $FILE_NAME && rm -rf /tmp/cookies.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment