Created
February 28, 2019 12:56
-
-
Save guysmoilov/ff68ef3416f99bd74a3c431b4f4c739a to your computer and use it in GitHub Desktop.
Bash script to download large zip files from google drive while confirming the virus scan warning
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
#!/bin/sh | |
# Usage: gdrive_download 123-abc ./output.zip | |
function gdrive_download () { | |
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://drive.google.com/uc?export=download&id=$1" -O- | sed -En 's/.*confirm=([0-9A-Za-z_]+).*/\1/p') | |
wget --load-cookies /tmp/cookies.txt "https://drive.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2 | |
rm -f /tmp/cookies.txt | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment