Skip to content

Instantly share code, notes, and snippets.

@a6y3ap
Created August 13, 2022 10:03
Show Gist options
  • Save a6y3ap/cf8dbe1e88d85d232069d921cc6bf904 to your computer and use it in GitHub Desktop.
Save a6y3ap/cf8dbe1e88d85d232069d921cc6bf904 to your computer and use it in GitHub Desktop.
How to download a Google Drive URL via WGET

How to download a Google Drive URL via WGET

For small file

Run following command on your terminal:

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

In the above command, change the FILEID by your file id and rename FILENAME for your own simple use.

For large file (greater than 32MB)

Run the following command with necessary changes in FILEID and FILENAME:

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

Tools:

You can also use this single purpose website which will generate this command for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment