Skip to content

Instantly share code, notes, and snippets.

@naartjie
Last active April 13, 2020 14:21
Show Gist options
  • Select an option

  • Save naartjie/bb8d5e9d14eadc9cd8e5adc1f5d208e1 to your computer and use it in GitHub Desktop.

Select an option

Save naartjie/bb8d5e9d14eadc9cd8e5adc1f5d208e1 to your computer and use it in GitHub Desktop.
Download a large file from Google Drive
# https://stackoverflow.com/questions/25010369/wget-curl-large-file-from-google-drive
pip3 install gdown
gdown https://drive.google.com/uc?id=$FILEID
# source: https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99
export FILEID="<..>"
export FILENAME="<..>"
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 \
https://docs.google.com/uc\?export=download\&id=$FILEID -O- \
| sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p' \
)&id=$FILEID" -O $FILENAME && \
rm -rf /tmp/cookies.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment