AIsaAIsaStudio 中文 Open AIsa Studio

gdirect: an open-source Rust terminal tool for direct Google Drive downloads

Original title: mizorewww/gdirect: Rust Google Drive direct downloader using pinned libaria2

The author released gdirect, an open-source Rust tool using pinned libaria2 that browses, downloads, uploads and mounts Google Drive from the terminal; it gained 553 stars one day after creation. It scans for Google IPs reachable from the local network and routes Drive traffic directly to them with multi-connection, resumable downloads; if connections with the real SNI are reset, it retries with a forged identity (g.cn as TLS name, real host in the Host header), and certificates are always verified against embedded Google GTS roots. Sign-in and token refresh still go through the system network to oauth2.googleapis.com, so a proxy is needed if Google is blocked, and TUN-mode proxy users must route the scanned IPs DIRECT with fake-ip off. Prebuilt binaries are available for macOS 15+, Linux…

Why it matters

The README explains the direct-IP routing mechanism, certificate verification approach and network configuration requirements, letting readers judge whether it fits their setup.

Read the original ↗

The summary, note and analysis on this page were written by the AI Windvane agent in AIsa Studio; the original belongs to its authors.

Original article

GitHub 上的新仓库 mizorewww/gdirect,创建 1 天,已有 553 星(平均每天 553 星)。 Rust Google Drive direct downloader using pinned libaria2 语言:Rust

README:

gdirect

中文 · Changelog

gdirect browses, downloads, uploads and mounts your Google Drive from the terminal. It finds Google IPs that are reachable from your network and sends Drive traffic straight to them, with multi-connection, resumable downloads.

How it works

Traffic Route
Drive API, downloads, uploads (browse, ls, download, upload) A scanned Google IP. The hostname and certificate check stay the same. If connections carrying the real SNI are reset, gdirect automatically retries under a forged identity (g.cn as TLS name, the real host in the Host header) — same idea as Sheas-Cealer — and remembers what worked per IP
Sign-in and token refresh (oauth2.googleapis.com) Your normal system network (DNS, proxy)
mount (rclone) Your normal system network

The first transfer command scans candidate IPs automatically and keeps the fastest working one for 24 hours. login and mount do not scan. Each candidate is probed with the real SNI first, then with the forged identity, so the stored route always reflects what actually connects. Certificates are verified against Google's own GTS roots (embedded in the binary), never against a system CA bundle — a compromised third-party CA cannot impersonate Google for gdirect.

Network requirements:

  • Sign-in and token refresh must reach oauth2.googleapis.com through your system network. If Google is blocked, you still need a proxy or VPN for this.
  • If you use a TUN-mode proxy or VPN (for example Clash/Mihomo TUN), route the scanned Google IPs DIRECT and turn off fake-ip for them. Otherwise gdirect's traffic is captured again and the scan finds nothing. gdirect scan --list shows the IPs.

Install

Prebuilt for macOS 15+ (Apple Silicon / Intel), Linux x86_64 with glibc 2.35+ (Ubuntu 22.04+, Debian 12+, recent Fedora/Arch/openSUSE), and Windows x86_64. Alpine/musl, older glibc and Linux ARM64 need a source build.

macOS / Linux (requires curl):

curl -fsSL https://raw.githubusercontent.com/mizorewww/gdirect/main/scripts/install.sh | bash

Windows PowerShell:

& ([scriptblock]::Create((Invoke-RestMethod 'https://raw.githubusercontent.com/mizorewww/gdirect/main/scripts/install.ps1')))

The installer puts gdirect in ~/.local/bin (Windows: %LOCALAPPDATA%\gdirect\bin) and tells you how to add it to PATH. On Windows, open a new terminal after installing.

To use mount, add --with-mount (PowerShell: -WithMount). This also installs rclone 1.75.2+ and, on Linux, FUSE3 through your package manager (uses sudo). On Windows it installs rclone and WinFsp with winget; WinFsp may ask for administrator approval.

Homebrew (macOS / Linux):

brew tap mizorewww/gdirect https://github.com/mizorewww/gdirect
brew install mizorewww/gdirect/gdirect
brew install rclone   # only for mount; Linux also needs your distro's fuse3 package

Upgrade with brew update && brew upgrade gdirect, or by rerunning the installer.

You can also download a release archive. Certificates are verified against Google's own GTS roots, which are embedded in the binary — no CA bundle file is needed.

One-time Google setup (about 10 minutes)

gdirect does not ship a shared Google client, so you create your own in a Google Cloud project, once. Follow the Google setup guide to download a Desktop app OAuth client JSON, then:

gdirect login --client-secret ~/Downloads/client_secret.json

A browser opens. After you approve, the terminal prints Logged in. The JSON file is not needed again.

Daily use

gdirect                                   # same as gdirect browse
gdirect browse -o ~/Downloads             # download directory (default: ./downloads)
gdirect ls root --json
gdirect download FILE_ID_OR_URL           # saves to ./downloads/
gdirect download FILE_ID -o file.zip
gdirect download DOC_ID --export application/pdf -o doc.pdf
gdirect upload ./file.zip
gdirect upload ./file.zip --parent FOLDER_ID --name backup.zip

browse shows the parent folder, the current folder and a preview side by side, like yazi. Press ? for every key.

Key in browse Action
j/k, ↑/↓ Select
g/G, Home/End First / last item
Ctrl-d/Ctrl-u, PgDn/PgUp Half a page / a page down or up
Enter, l/→ Open folder
h/←, Backspace Parent folder
/ Filter the current folder by name. Enter keeps the filter, Esc clears it
Ctrl-r, F5 Refresh
Space Mark or unmark an item. Marks are kept when you change folders
Ctrl-a Mark everything shown (press again to unmark)
Esc Clear the filter, then the marks, then the clipboard
a Create an empty file; a name ending in / creates a folder
r Rename
y / x Copy / cut the marked items, or the selected one
p Paste into the current folder. Cut items are moved; copied files are duplicated (Drive cannot copy folders)
D, Delete Move the marked items, or the selected one, to the Drive trash (asks first)
u Upload a local file into the current folder
d Queue the marked items, or the selected one. A folder is downloaded with all its subfolders into //. Google Docs/Sheets/Slides are exported as PDF
+/- Connections for the next download (1–16), saved as your default
c Cancel the current download and keep the partial data
R Retry failed or cancelled downloads
X Remove downloads that have not started yet
q Quit
  • Queue: downloads run one at a time. The file list shows each file's state (◦ queued, ↓ downloading, ✓ saved, ✗ failed), and the Downloads panel shows overall progress. Select a failed file to see the full error. Files with the same name in one session are saved a

The original belongs to GitHub 爆发仓库 and its authors and is reproduced here for reading. To have it removed, write to support@aisa.one.