Skip to main content

Google Drive Public File/Folder Downloader

Project description


Google Drive Public File/Folder Downloader

Gdown downloads a public file/folder from Google Drive.

Gdown provides what's curl/wget doesn't for Google Drive:

  • Skip the security notice allowing you to download large files;
  • Recursive download of files in a folder (maximum 50 files per folder);
  • Specify download file format for Google Slides/Sheet/Docs like PDF/XML/CSV.


pip install gdown

# to upgrade
pip install --upgrade gdown


From Command Line

$ gdown --help
usage: gdown [-h] [-V] [-O OUTPUT] [-q] [--fuzzy] [--id] [--proxy PROXY]
             [--speed SPEED] [--no-cookies] [--no-check-certificate]
             [--continue] [--folder] [--remaining-ok]

$ # a large file (~500MB)
$ gdown
$ md5sum fcn8s_from_caffe.npz

$ # same as the above but with the file ID
$ gdown 1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ

$ # a small file
$ gdown
$ cat spam.txt

$ # download with fuzzy extraction of a file ID
$ gdown --fuzzy ''
$ cat spam.txt

$ # --fuzzy option also works with Microsoft Powerpoint files
$ gdown --fuzzy ""

$ # a folder
$ gdown -O /tmp/folder --folder

$ # as an alternative to curl/wget
$ gdown -O ip.json
$ cat ip.json
  "origin": ""

$ # write stdout and pipe to extract
$ gdown -O - --quiet | tar zxvf -
$ ls gdown-4.0.0/
gdown  github2pypi  LICENSE  pyproject.toml  setup.cfg  tests

From Python

import gdown

# a file
url = ""
output = "fcn8s_from_caffe.npz", output, quiet=False)

# same as the above, but with the file ID
id = "0B9P1L--7Wd2vNm9zMTJWOGxobkU", output=output, quiet=False)

# same as the above, and you can copy-and-paste a URL from Google Drive with fuzzy=True
url = "", output=output, quiet=False, fuzzy=True)

# cached download with identity check via MD5
md5 = "fa837a88f0c40c513d975104edf3da17"
gdown.cached_download(url, output, md5=md5, postprocess=gdown.extractall)

# a folder
url = ""
gdown.download_folder(url, quiet=True, use_cookies=False)

# same as the above, but with the folder ID
id = "15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl"
gdown.download_folder(id=id, quiet=True, use_cookies=False)


I get 'Permission Denied' error.

Have you made sure you set the file permission to 'Anyone with Link'?

I set the permission 'Anyone with Link', but still can't download.

Google restricts access to a file when the download is concentrated. If you can still access to the file from your browser, downloading cookies file might help. Follow this step: 1) download cookies.txt using browser extensions like (Get cookies.txt LOCALLY); 2) mv the cookies.txt to ~/.cache/gdown/cookies.txt; 3) run download again. If you're using gdown>=5.0.0, it should be able to use the cookies same as your browser.



Project details

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdown-5.0.0rc1.tar.gz (241.6 kB view hashes)

Uploaded Source

Built Distribution

gdown-5.0.0rc1-py3-none-any.whl (16.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page