Created
September 14, 2020 02:20
-
-
Save crazygit/fef47bf7e1a52bafbc029b60dd6a08a1 to your computer and use it in GitHub Desktop.
Download Google Drive Files using wget
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
#!/usr/bin/env bash | |
# reffer: | |
# https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99 | |
file_name="youer_file_name" | |
file_id="your_file_id" | |
confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=${file_id}" -O-| sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p') | |
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=${confirm}&id=${field_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