Skip to main content

gdown

PyPI Python Build License

Google Drive public file/folder downloader when curl/wget fails.

Why?

Downloading public files from Google Drive with curl or wget doesn't work — Google serves a confirmation page for large files, and the URL formats are a mess.

gdown gets around that:

  • Skips the virus-scan confirmation page so large downloads actually finish
  • Downloads folders recursively
  • Exports Google Docs/Sheets/Slides as PDF, DOCX, CSV, etc.
  • Resumes partial downloads with --continue
  • Also works with plain HTTP/HTTPS URLs as a curl/wget replacement

Install

Requires Python 3.10 or later.

pip install gdown

Or with uv:

uv tool install gdown

Quick start

# Just paste a Google Drive URL
gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ

# Or copy-paste a share link directly
gdown 'https://drive.google.com/file/d/0B9P1L--7Wd2vU3VUVlFnbTgtS2c/view?usp=sharing'

Usage

CLI

Files

# Download by URL
gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ

# Download by file ID
gdown 1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ

# Download from a share link
gdown 'https://drive.google.com/file/d/0B9P1L--7Wd2vU3VUVlFnbTgtS2c/view?usp=sharing'

# Save to a specific path
gdown https://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c -O /tmp/spam.txt

# Resolve the filename (with its real extension) without downloading
gdown https://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c --json

--json is in beta and its output format may change in a future release; pass --quiet to silence the beta warning in scripts. The output is an array of {url, path} entries, where path is the filename Google Drive reports. This lets you choose a name while keeping the original extension:

url="https://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c"
filename=$(gdown "$url" --json | jq -r '.[0].path')
gdown "$url" -O "my_name.${filename##*.}"

Folders

# Download an entire folder
gdown https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl -O /tmp/folder --folder

# List folder contents as a JSON array (each entry has url and path)
gdown https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl --folder --json

# Filter by path and download matches
gdown https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl --folder --json \
  | jq -r '.[] | select(.path | test("shad")) | .url' \
  | xargs -n1 gdown

Google Docs, Sheets, Slides

# Download a Google Slides file (default: pptx)
gdown "https://docs.google.com/presentation/d/15umvZKlsJ3094HNg5S4vJsIhxcFlyTeK/edit?usp=sharing"

# Export as PDF instead
gdown "https://docs.google.com/presentation/d/15umvZKlsJ3094HNg5S4vJsIhxcFlyTeK/edit" --format pdf

Default export formats: Docs → docx, Sheets → xlsx, Slides → pptx.

Resume, speed limit, proxy

# Resume a partially downloaded file
gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ --continue

# Limit download speed
gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ --speed 10MB

# Download via proxy
gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ --proxy http://proxy:8080

Other options

# Skip TLS certificate verification
gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ --no-check-certificate

# Don't use cookies from ~/.cache/gdown/cookies.txt
gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ --no-cookies

# Use a custom User-Agent
gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ --user-agent "MyApp/1.0"

Pipe to stdout

gdown https://github.com/wkentaro/gdown/archive/refs/tags/v4.0.0.tar.gz -O - --quiet | tar zxvf -

Any URL

gdown also works with regular URLs, not just Google Drive:

gdown https://httpbin.org/ip -O ip.json

[!NOTE] For Google Drive URLs, gdown automatically extracts the file ID and downloads the actual file. Use curl or wget to download the raw HTML page instead.

Python

import gdown

# Download a file
url = "https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ"
gdown.download(url=url, output="fcn8s_from_caffe.npz")

# Download by file ID
gdown.download(id="0B9P1L--7Wd2vNm9zMTJWOGxobkU", output="output.npz")

# Download from a share link
url = "https://drive.google.com/file/d/0B9P1L--7Wd2vNm9zMTJWOGxobkU/view?usp=sharing"
gdown.download(url=url, output="output.npz")

# Download with hash verification and caching
gdown.cached_download(
    url=url,
    path="output.npz",
    hash="md5:fa837a88f0c40c513d975104edf3da17",
    postprocess=gdown.extractall,
)

# Track download progress
def on_progress(bytes_so_far: int, bytes_total: int | None) -> None:
    if bytes_total is not None:
        print(f"\r{bytes_so_far / bytes_total * 100:.1f}%", end="")

gdown.download(url=url, output="output.npz", quiet=True, progress=on_progress)

# Download a folder
url = "https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl"
gdown.download_folder(url=url)

# Download a folder by ID
gdown.download_folder(id="15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl")

FAQ

"Permission Denied" error

Make sure the file sharing is set to "Anyone with the link".

Download still fails even with "Anyone with the link"

Google throttles downloads when too many people access the same file. If you can still open the file in your browser, try exporting cookies:

  1. Install a browser extension like Get cookies.txt LOCALLY
  2. Export cookies.txt and move it to ~/.cache/gdown/cookies.txt
  3. Run the download again

Once the file is in place, gdown loads it automatically (no extra flags needed).

Download stops after ~1 hour

Google Drive terminates connections after approximately 1 hour for large files. Use --continue to resume, and retry until the download completes:

gdown --continue https://drive.google.com/uc?id=<file_id>

Can I use gdown for non-Google-Drive URLs?

Yes. It works with any public HTTP/HTTPS URL.

Contributing

git clone https://github.com/wkentaro/gdown.git
cd gdown
make setup   # install dependencies
make test    # run tests
make lint    # run linters

License

MIT (LICENSE)

Download files

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

Source Distribution

gdown-6.1.1.tar.gz (285.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gdown-6.1.1-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file gdown-6.1.1.tar.gz.

File metadata

  • Download URL: gdown-6.1.1.tar.gz
  • Upload date:
  • Size: 285.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gdown-6.1.1.tar.gz
Algorithm Hash digest
SHA256 34cd14ac1280bc9085266e4771df2a3bea125e7853313d902e976640068389d5
MD5 33e4282e39ec52bb941563bdf8969d05
BLAKE2b-256 4e2ad25ab185c35c0875dd0fb1d869baae844e8662ee19ef82721dfa32bfc901

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdown-6.1.1.tar.gz:

Publisher: release.yml on wkentaro/gdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdown-6.1.1-py3-none-any.whl.

File metadata

  • Download URL: gdown-6.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gdown-6.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f269042526d398bbcdedf8cf97b059640a716824438828c46c0f01f2281d680
MD5 0aaf7e0de40e887ec10db4cc09b7612c
BLAKE2b-256 a3d078c1619c418fd2f43cd80773cba5298f7fb83a24f0177090dc682a538589

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdown-6.1.1-py3-none-any.whl:

Publisher: release.yml on wkentaro/gdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

6.2.0

2 files

This release

6.1.1 This release

2 files

6.1.0

2 files

6.0.0

2 files

5.2.2

2 files

5.2.1

2 files

5.2.0

2 files

5.1.0

2 files

5.0.1

2 files

5.0.0

2 files

4.7.3

2 files

4.7.2

2 files

4.7.1

2 files

4.7.0

2 files

4.6.6

2 files

4.6.5

2 files

4.6.4

2 files

4.6.3

2 files

4.6.2

2 files

4.6.1

2 files

4.6.0

2 files

4.5.4

2 files

4.5.3

2 files

4.5.2

1 file

4.5.1

1 file

4.5.0

1 file

4.4.0

1 file

4.3.1

1 file

4.3.0

1 file

4.2.2

1 file

4.2.1

1 file

4.2.0

1 file

4.1.1

1 file

4.1.0

1 file

4.0.2

1 file

4.0.1

1 file

4.0.0

1 file

3.15.0

1 file

3.14.0

1 file

3.13.1

1 file

3.13.0

1 file

3.12.2

1 file

3.12.1

1 file

3.12.0

1 file

3.11.1

1 file

3.11.0

1 file

3.10.3

1 file

3.10.2

1 file

3.10.1

1 file

3.10.0

1 file

3.9.1

1 file

3.9.0

1 file

3.8.3

1 file

3.8.2

1 file

3.8.1

1 file

3.8.0

1 file

3.7.4

1 file

3.7.3

1 file

3.7.1

1 file

3.7.0

1 file

3.6.4

1 file

3.6.3

1 file

3.6.2

1 file

3.6.1

1 file

3.6.0

1 file

3.5.0

1 file

3.4.6

1 file

3.4.5

1 file

3.4.4

1 file

3.4.3

1 file

3.4.2

1 file

3.4.1

1 file

3.4.0

1 file

3.3.2

1 file

3.3.1

1 file

3.3.0

1 file

3.2.5

1 file

3.2.4

1 file

3.2.3

1 file

3.2.2

1 file

3.2.1

1 file

3.2.0

1 file

3.1.0

1 file

3.0.0

1 file

2.3.1

1 file

2.3.0

1 file

2.2.0

1 file

2.1.1

1 file

2.1.0

1 file

2.0.2

1 file

2.0.1

1 file

2.0.0

1 file

1.0.2

1 file

1.0.1

1 file

1.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page