Last active
June 2, 2021 04:11
-
-
Save rebornplusplus/709d75ba32248e8ba987bb673304181d to your computer and use it in GitHub Desktop.
Download Google Drive Files using wget
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: (saves to FILENAME) | |
# ./wget_gdrive.sh FILEID FILENAME | |
# https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99 | |
# Copy the link for sharing: https://drive.google.com/file/d/1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA/view?usp=sharing | |
# Extract FILEID part: 1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA | |
# For small (<100MB) files: | |
# wget --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O $2 | |
# For large files: | |
wget -c --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget -c --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$1" -O $2 && rm -rf /tmp/cookies.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment