Download public shared google drive large file with wget

Maybe outdated.

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