Package: gdown
gdownGoogle Drive Public File Downloader when Curl/Wget FailsGdowndownloads a public file/folder from Google Drive.Gdownprovides what's curl/wget doesn't for Google Drive:Skip the security noticeallowing you to download large files (curl/wget fails);Recursive downloadof files in a folder (maximum 50 files per folder);Specify download file formatfor Google Slides/Sheet/Docs like PDF/XML/CSV.Installationpipinstallgdown# to upgradepipinstall--upgradegdownUsagevia Command Line$gdown--help
usage:gdown[-h][-V][-OOUTPUT][-q][--fuzzy][--id][--proxyPROXY][--speedSPEED][--no-cookies][--no-check-certificate][--continue][--folder][--remaining-ok]url_or_id
...

$# a large file (~500MB)$gdownhttps://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ
$md5sumfcn8s_from_caffe.npz
256c2a8235c1c65e62e48d3284fbd384

$# same as the above but with the file ID$gdown1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ

$# a small file$gdownhttps://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c
$catspam.txt
spam

$# download with fuzzy extraction of a file ID$gdown--fuzzy'https://drive.google.com/file/d/0B9P1L--7Wd2vU3VUVlFnbTgtS2c/view?usp=sharing&resourcekey=0-WWs_XOSctfaY_0-sJBKRSQ'$catspam.txt
spam

$# --fuzzy option also works with Microsoft Powerpoint files$gdown--fuzzy"https://docs.google.com/presentation/d/15umvZKlsJ3094HNg5S4vJsIhxcFlyTeK/edit?usp=sharing&ouid=117512221203072002113&rtpof=true&sd=true"$# a folder$gdownhttps://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl-O/tmp/folder--folder

$# as an alternative to curl/wget$gdownhttps://httpbin.org/ip-Oip.json
$catip.json{"origin":"126.169.213.247"}$# write stdout and pipe to extract$gdownhttps://github.com/wkentaro/gdown/archive/refs/tags/v4.0.0.tar.gz-O---quiet|tarzxvf-
$lsgdown-4.0.0/
gdowngithub2pypiLICENSEMANIFEST.inpyproject.tomlREADME.mdsetup.cfgsetup.pytestsvia Pythonimportgdown# a fileurl="https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ"output="fcn8s_from_caffe.npz"gdown.download(url,output)# same as the above, but with the file IDid="0B9P1L--7Wd2vNm9zMTJWOGxobkU"gdown.download(id=id,output=output)# same as the above, and you can copy-and-paste a URL from Google Drive with fuzzy=Trueurl="https://drive.google.com/file/d/0B9P1L--7Wd2vNm9zMTJWOGxobkU/view?usp=sharing"gdown.download(url=url,output=output,fuzzy=True)# Cached download with identity check via MD5 (or SHA1, SHA256, etc).# Pass postprocess function e.g., extracting compressed file.md5="md5:fa837a88f0c40c513d975104edf3da17"gdown.cached_download(url,output,hash=hash,postprocess=gdown.extractall)# a folderurl="https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl"gdown.download_folder(url)# same as the above, but with the folder IDid="15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl"gdown.download_folder(id=id)FAQI 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 thecookies.txtto~/.cache/gdown/cookies.txt; 3) run download again.
If you're usinggdown>=5.0.0, it should be able to use the cookies same as your browser.LicenseMIT