A lot has changed since v5.2.1 back in January. 33 pull requests (109 commits) went into this release, touching nearly every part of the codebase.
Highlights
gdown --folder/download_folder()now supports folders with more than 50 filesdownload()raisesDownloadErroron failure instead of returningNone- New
progressparameter indownload() - Path traversal vulnerability fixed in
extractall()(GHSA-76hw-p97h-883f) - All deprecated APIs from v5 have been (finally) removed
- Python 3.10+ required (3.8 and 3.9 dropped)
Most users should be able to upgrade without issues. The one change that will likely need code updates is the switch from returning None to raising DownloadError on failure.
Breaking changes
-
download()anddownload_folder()now raiseDownloadErrorinstead of returningNone(#451)Previously,
download()anddownload_folder()returnedNonewhen a download failed. Now, they raiseDownloadError(or its subclassFileURLRetrievalError).If your code looks like this:
output = gdown.download(url, output="file.txt") if output is None: print("Download failed")
Change it to:
try: output = gdown.download(url, output="file.txt") except gdown.DownloadError as e: print(f"Download failed: {e}")
-
fuzzyparameter and--fuzzyCLI flag removed (#455)Previously, you needed
fuzzy=True(or--fuzzy) to download from Google Drive share links likehttps://drive.google.com/file/d/FILE_ID/view. gdown now always extracts the file ID from any Google Drive URL format. Just pass the URL directly. -
--remaining-okflag andFolderContentsMaximumLimitErrorremoved (#453)Folder downloads used to be limited to 50 files due to a Google Drive API constraint, and
--remaining-oklet you proceed with a partial download. gdown now uses theembeddedfolderviewendpoint, which has no file count limit. The flag and exception class are no longer needed. -
md5parameter removed fromcached_download()(#450)The
md5parameter was deprecated in v5. Use thehashparameter instead:# Before gdown.cached_download(url, md5="abc123") # After gdown.cached_download(url, hash="md5:abc123")
-
--idCLI flag,md5sum(), andassert_md5sum()removed (#448, #449)These were deprecated in v5. Use
gdown.parse_url()for URL parsing andhashlibfor checksum verification. -
Python 3.8 and 3.9 are no longer supported (#423)
gdown now requires Python 3.10 or later. Python 3.10 through 3.14 are tested in CI.
Security fixes
-
Arbitrary file write via path traversal in
extractall()(GHSA-76hw-p97h-883f)gdown.extractall()now validates that archive members stay within the target directory, preventing zip or tar archives from writing files outside the extraction path via../traversal, absolute paths, or symlinks. On Python 3.12+, extraction uses thedatafilter. (#445, #446, #447)
Features
- New
progressparameter indownload()for hooking into download progress (#427) - Folder downloads now support more than 50 files via the
embeddedfolderviewendpoint (#453)
Bug fixes
- Detect Google Docs/Sheets/Slides via URL patterns instead of page title, fixing downloads on non-English Google accounts (#438)
- Sanitize path separators in filenames on all platforms (#437)
- Handle corrupted cookies file instead of crashing (#441)
- Fix output directory detection and filename handling on Windows (#440)
- Append correct extension for Google exports in folder downloads (#443)
- Return
Noneinstead ofFalsefromparse_url()for non-Google-Drive URLs (#434) - Remove redundant resume check in
download_folder()(#444)