Skip to content

Instantly share code, notes, and snippets.

@emxsys
Last active July 15, 2025 20:18
Show Gist options
  • Save emxsys/a64352e7f981f9eae400e989b0bbb3d0 to your computer and use it in GitHub Desktop.
Save emxsys/a64352e7f981f9eae400e989b0bbb3d0 to your computer and use it in GitHub Desktop.
Download Google Drive files with WGET

How to download files from Google Drive with WGET

Step 1. Get the ID of the file to download

  1. Get a shareable link from Google Drive by right-clicking the file and selecting Get Shareable Link.

  2. Examine the link to get the file's ID. Example:

    https://docs.google.com/open?id=[ID]

Step 2. Download the file with WGET

  1. Build the download URL using the ID obtained in Step 1. Example:

    https://drive.google.com/uc?export=download&id=[ID]

  2. Run WGET with the URL. Usage: wget [OPTION]... [URL].... Example:

    wget -O [filename] --no-check-certificate -r 'https://drive.google.com/uc?export=download&id=[ID]'

      Options used:
      -O, --output-document=FILE  writes document to FILE
      --no-check-certificate      don't validate the server's certificate
      -r                          recursive
    

These instructions were inspired by the Gist and comments at https://gist.github.com/iamtekeste/3cdfd0366ebfd2c0d805

@iamacarpet
Copy link

It looks like this has changed slightly, specifically for larger files.

I'm finding your above URL returns a HTML form rather than the file - the actual file can be fetched from this URL:

https://drive.usercontent.google.com/download?export=download&id=[ID]&confirm=t

@aw632
Copy link

aw632 commented Jul 15, 2025

This doesn't seem to work anymore. It just downloads a 2KB file which is probably the confirmation form, even with confirm=t set.

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