Registry / data / gdown

gdown

JSON →
library5.2.1pypypi✓ verified 49d ago

gdown is a Python package (current version 5.2.1) designed to download public files and folders from Google Drive, providing functionality that standard tools like curl or wget often lack for Google Drive links. It handles large files by skipping security notices and supports recursive downloads for folders (up to 50 files per folder). The library has an active development cycle with regular updates addressing features, enhancements, and bug fixes.

datahttp-networking
pip install gdown
Install & Compatibility
Where this runs
tested against v6.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.925 runs
installs and imports cleanly · install 0.0s · import 1.382s · 23.6MB
glibc
py 3.103.925 runs
installs and imports cleanly · install 2.6s · import 1.227s · 24MB
22MB installed
● package 22MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gdown
import gdown

This quickstart demonstrates how to download a publicly accessible file from Google Drive using its URL. The `gdown.download()` function handles the process, including bypassing Google Drive's security notices for large files. The example also includes cleanup for repeatability.

import gdown import os # A public Google Drive file URL (replace with your desired file if needed) # This specific file is a public example from the gdown GitHub repo url = "https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ" output_filename = "fcn8s_from_caffe.npz" try: gdown.download(url, output_filename, quiet=False) print(f"Successfully downloaded {output_filename}") except Exception as e: print(f"Error downloading file: {e}") finally: # Clean up the downloaded file for a repeatable quickstart if os.path.exists(output_filename): os.remove(output_filename) print(f"Cleaned up {output_filename}")
gdown --version
Debug
Known issues
breakinggdown dropped support for Python 2 in version 5.0.0. The library now requires Python 3.8 or higher.
fix
Upgrade your Python environment to 3.8+ and gdown to version 5.0.0 or later.
affects: < 5.0.0
gotchaOlder versions of gdown (before 4.7.3) might fail to download files due to changes in Google Drive's User-Agent handling.
fix
Upgrade gdown to version 4.7.3 or later to ensure compatibility with Google Drive's User-Agent requirements.
affects: < 4.7.3
deprecatedThe `--id` command-line option was deprecated in version 4.3.1 and removed in 5.0.0. File IDs or URLs can now be passed directly without the `--id` flag.
fix
Remove the `--id` flag when using the CLI; simply pass the file ID or URL as an argument.
affects: < 5.0.0
gotchaPrior to v5.2.1, if hash verification failed for a downloaded file, a corrupted file might have been left in the final destination. Hash verification now occurs before moving the file.
fix
Upgrade to gdown >= 5.2.1 to ensure that files are only moved to their final location after successful hash verification, preventing corrupted files from being retained.
affects: < 5.2.1
gotchaFiles and folders downloaded via gdown must have their sharing permissions set to 'Anyone with the link can view' on Google Drive.
fix
Ensure the Google Drive file or folder you are trying to download has appropriate public sharing permissions.
affects: All versions
gotchaWhen downloading folders, gdown has a limitation of processing a maximum of 50 files per folder. Attempting to download larger folders may result in incomplete downloads.
fix
For folders with more than 50 files, consider manually splitting them into smaller folders on Google Drive or compressing the folder into a single archive (e.g., a .zip file) before downloading.
affects: All versions
breakingIn `gdown.cached_download`, the `md5` argument was replaced with a more general `hash` argument in v5.1.0 to support various hash algorithms.
fix
If using `gdown.cached_download`, update your code to use the `hash` parameter instead of `md5` and specify the desired hash algorithm (e.g., `hash='sha256:...'`).
affects: < 5.1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'gdown'
The 'gdown' package is not installed in the current Python environment.
fix
Run `pip install gdown` in your terminal or `!pip install gdown` in a Jupyter Notebook to install the package.
Access denied with the following error: Cannot retrieve the public link of the file. You may need to change the permission to 'Anyone with the link', or have had many accesses.
The Google Drive file or folder is not publicly accessible (sharing setting not 'Anyone with the link can view') or Google is temporarily throttling access due to a high number of requests.
fix
Ensure the Google Drive file's sharing setting is set to 'Anyone with the link' with viewer permissions. If access is still denied, Google might be throttling downloads; try again later or, for persistent issues, consider exporting browser cookies and placing them in `~/.cache/gdown/cookies.txt`, or using the `--no-cookies` flag with the CLI or `use_cookies=False` with the Python API.
Download quota exceeded for this file, so you can't download it at this time.
Google Drive has imposed a temporary download limit for the file, often due to a high volume of downloads or very large file sizes from that specific link.
fix
Wait for the quota to reset (typically 24 hours). For critical large files, you might try copying the file to your own Google Drive and generating a new public link, or breaking down large downloads into smaller sessions, or using `--no-cookies`.
gdown: command not found
The 'gdown' executable script's directory is not in your system's PATH environment variable, or 'gdown' was installed in a virtual environment that is not currently active.
fix
Activate your Python environment if using one. In Jupyter, use `!pip install gdown` (or `%pip install gdown` for modern versions) and then `!python -m gdown.cli --id <FILE_ID>` or `gdown.download(id='<FILE_ID>', output='output_file')` in Python. For global CLI use, verify that Python's script directory (where `gdown` is installed) is correctly added to your system's PATH.
Upgrade
Version history
6.1.0latest on PyPI
Audit
Dependencies
requestsrequiredUsed for HTTP requests to Google Drive.
pythonrequiredRequires Python 3.8 or higher.
Agent activity
24 hits · last 30 days
node
4
claudebot
4
seranking-bot
4
gptbot
3
bytedance
2
oai-searchbot
2
Amazon
1
ahrefsbot
1
googlebot
1
Resources