No description
- C# 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Lists the whole tree from Drive's embedded folder view (no 50-file cutoff), downloads several files at a time with size checks and resume, and gives same-named Drive entries "(2)", "(3)" suffixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
| .gitignore | ||
| DriveGrab.csproj | ||
| Program.cs | ||
| README.md | ||
DriveGrab
Downloads every file of a public Google Drive folder (or a single file), keeping the folder structure. It needs no Google account or API key. The link only has to be shared as "Anyone with the link".
DriveGrab <link or id> [destination] [--list] [--parallel N] [--overwrite]
DriveGrab "https://drive.google.com/drive/folders/1wtLARgkGRZ_Dc84N4RZlX-JX_rxK0ADs" "D:\Hobby\LostKingdom\2026-10"
DriveGrab "https://drive.google.com/drive/folders/1wtLARgkGRZ_Dc84N4RZlX-JX_rxK0ADs" --list
DriveGrab "https://drive.google.com/file/d/<id>/view" D:\Downloads
| Option | |
|---|---|
destination |
the folder to download into (default: the current folder) |
--list |
lists the files with their sizes and the total; downloads nothing |
--parallel N |
how many files download at a time (default 4) |
--overwrite |
downloads again even when a file of the right size is already there |
What it does
- Listing: it reads the whole folder tree from Drive's embedded folder view. That view lists every file; Drive's normal page shows only the first 50 in a folder. File sizes come from the folder pages, or from Drive directly for files beyond the first 50.
- Downloading: each file is written as
<name>.part. When the size matches both the download and Drive's listing, the file is renamed. A broken download never leaves a half file under the real name. Each file gets 3 tries. - Resuming: run the same command again. Files already there at the right size are skipped, so it only fetches what's missing or failed. Exit code 0 means everything is there.
- Names: characters Windows doesn't allow in names (
\ / : * ? " < > |) become spaces. For example, "500 reward-Ojancano/Cuegle" becomes "500 reward-Ojancano Cuegle". - Same names: Drive allows two files with the same name in one folder. The second is saved as "name (2).ext", the third as "name (3).ext", and so on.
- Google Docs, Sheets and Slides aren't files. They're listed as skipped.
Limits
- Quota: Drive limits how much one shared file can be downloaded per day. When it's exceeded, Drive sends a web page instead of the file. DriveGrab reports that file as failed (with the reason); try again later.
- Unofficial: it uses Drive's public pages rather than its official API, so a change at Google could break it. If listing fails on a link that opens fine in a browser, that's the likely cause.
Build
dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o D:\Workspace\build\DriveGrab\publish
This gives DriveGrab.exe, a single file that needs the .NET 10 runtime. Or run it from source:
dotnet run --project Tools\DriveGrab -- <link> [destination].