Skip to content

Instantly share code, notes, and snippets.

@recolic
Created October 20, 2018 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save recolic/4bb024580e41b2e4755f4c6721f6c4b6 to your computer and use it in GitHub Desktop.
Save recolic/4bb024580e41b2e4755f4c6721f6c4b6 to your computer and use it in GitHub Desktop.
Download public shared google drive large file with wget. by vladalive

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment