{"id":2041,"library":"gdown","title":"gdown: Google Drive Public File/Folder Downloader","description":"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.","status":"active","version":"5.2.1","language":"python","source_language":"en","source_url":"https://github.com/wkentaro/gdown","tags":["google-drive","download","cli","file-management"],"install":[{"cmd":"pip install gdown","lang":"bash"}],"dependencies":[{"reason":"Used for HTTP requests to Google Drive.","package":"requests","optional":false},{"reason":"Requires Python 3.8 or higher.","package":"python","optional":false}],"imports":[{"symbol":"gdown","correct":"import gdown"}],"quickstart":{"code":"import gdown\nimport os\n\n# A public Google Drive file URL (replace with your desired file if needed)\n# This specific file is a public example from the gdown GitHub repo\nurl = \"https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ\"\noutput_filename = \"fcn8s_from_caffe.npz\"\n\ntry:\n    gdown.download(url, output_filename, quiet=False)\n    print(f\"Successfully downloaded {output_filename}\")\nexcept Exception as e:\n    print(f\"Error downloading file: {e}\")\nfinally:\n    # Clean up the downloaded file for a repeatable quickstart\n    if os.path.exists(output_filename):\n        os.remove(output_filename)\n        print(f\"Cleaned up {output_filename}\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.8+ and gdown to version 5.0.0 or later.","message":"gdown dropped support for Python 2 in version 5.0.0. The library now requires Python 3.8 or higher.","severity":"breaking","affected_versions":"< 5.0.0"},{"fix":"Upgrade gdown to version 4.7.3 or later to ensure compatibility with Google Drive's User-Agent requirements.","message":"Older versions of gdown (before 4.7.3) might fail to download files due to changes in Google Drive's User-Agent handling.","severity":"gotcha","affected_versions":"< 4.7.3"},{"fix":"Remove the `--id` flag when using the CLI; simply pass the file ID or URL as an argument.","message":"The `--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.","severity":"deprecated","affected_versions":"< 5.0.0"},{"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.","message":"Prior 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.","severity":"gotcha","affected_versions":"< 5.2.1"},{"fix":"Ensure the Google Drive file or folder you are trying to download has appropriate public sharing permissions.","message":"Files and folders downloaded via gdown must have their sharing permissions set to 'Anyone with the link can view' on Google Drive.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"When 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.","severity":"gotcha","affected_versions":"All versions"},{"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:...'`).","message":"In `gdown.cached_download`, the `md5` argument was replaced with a more general `hash` argument in v5.1.0 to support various hash algorithms.","severity":"breaking","affected_versions":"< 5.1.0"}],"env_vars":null,"search_vec":"'5.2.1':14 '50':56 'activ':64 'address':70 'bug':74 'cli':80 'curl':31 'current':12 'cycl':66 'design':15 'develop':65 'download':6,17,51,79 'drive':3,24,38,78 'enhanc':72 'featur':71 'file':19,43,57,82 'file-manag':81 'file/folder':5 'fix':75 'folder':21,53,59 'function':26 'gdown':1,7 'googl':2,23,37,77 'google-dr':76 'handl':41 'lack':35 'larg':42 'librari':61 'like':30 'link':39 'manag':83 'notic':47 'often':34 'packag':11 'per':58 'provid':25 'public':4,18 'python':10 'recurs':50 'regular':68 'secur':46 'skip':45 'standard':28 'support':49 'tool':29 'updat':69 'version':13 'wget':33","created_at":"2026-04-09T18:40:59.513450+00:00","updated_at":"2026-04-16T15:14:03.260675+00:00","problems":[{"fix":"Run `pip install gdown` in your terminal or `!pip install gdown` in a Jupyter Notebook to install the package.","cause":"The 'gdown' package is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'gdown'"},{"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.","cause":"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.","error":"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."},{"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`.","cause":"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.","error":"Download quota exceeded for this file, so you can't download it at this time."},{"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.","cause":"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.","error":"gdown: command not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"6.1.0","cli_name":"gdown","cli_version":"gdown 6.0.0 at /usr/local/lib/python3.11/site-packages","type":"library","homepage":null,"github":"https://github.com/wkentaro/gdown","docs":null,"changelog":null,"pypi":"https://pypi.org/project/gdown/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}