Created
February 29, 2020 18:17
-
-
Save Sohil876/a00e91408527d06626e5b29cf978fd48 to your computer and use it in GitHub Desktop.
-:Download Gdrive files through 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
Command for downloading any big file from google drive (for big file we need confirm download) | |
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 | |
I've used @beliys code and made a bash command. | |
Setup: | |
Add this code to your ~/.bash_aliases file. | |
function gdrive_download () { | |
CONFIRM=$(wget --quiet --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') | |
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2 | |
rm -rf /tmp/cookies.txt | |
} | |
Open new bash session. | |
Usage: | |
gdrive_download long_google_drive_file_id filename.ext | |
https://github.com/GitHub30/gdrive.sh | |
https://stackoverflow.com/questions/25010369/wget-curl-large-file-from-google-drive/32441141#32441141 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment