Add this to your ./bashaliases
or ./bashrc
file. You can also enter as a one time on your bash terminal
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
}
Usage:
gdrive_download Google_drive_file_id filename.ext
Explantion:
Google_drive_file_id: the id is as below, after d/ and before /edit
Example: https://drive.google.com/file/d/1yB4LvoPJG7KrF65FlvtG8kDm-uG-6781/edit
id: 1yB4LvoPJG7KrF65FlvtG8kDm-uG-6781
Credits: @vladalive