Drive Video Download
Downloads Google Drive videos that have download restrictions (canDownload: false) by piggybacking on the user's active browser session (Brave or Chrome) via CDP.
When to use
- Drive API returns
"cannotDownloadFile"orcanDownload: false - yt-dlp returns HTTP 403 on the Drive URL
- File is a Google Meet/Workspace recording with admin-disabled downloads
- Any shared corporate video the user can view but not download
Prerequisites
- Brave or Chrome is running and the user is logged in to Google
- Remote debugging enabled:
- Brave:
brave://inspect/#devices→ toggle the switch - Chrome:
chrome://inspect/#devices→ toggle "Discover network targets"
- Brave:
- The user can view the file in their browser (even if download is blocked)
- Node.js 22+ (uses built-in WebSocket)
Usage
# Basic — outputs to /tmp/drive-<fileId>.m4a
node ~/.claude/skills/drive-video-download/scripts/download.mjs <file-id-or-url>
# With custom output path
node ~/.claude/skills/drive-video-download/scripts/download.mjs <file-id-or-url> /tmp/recording.m4a
Both full Drive URLs and bare file IDs work:
node ~/.claude/skills/drive-video-download/scripts/download.mjs "https://drive.google.com/file/d/<your-file-id>/view"
node ~/.claude/skills/drive-video-download/scripts/download.mjs <your-file-id>
The script prints the output file path to stdout on success.
What the script does
- Reads
DevToolsActivePortfrom the browser profile — auto-detects Brave, Chrome, or Chromium on macOS/Linux - Finds or opens the Drive file tab in the browser
- Reloads the tab and intercepts the
workspacevideo-pamanifest response via CDP Network domain — this gives a signed streaming URL foritag=140(audio-only m4a, ~128kbps, ideal for transcription) - Opens a same-origin tab at the videoplayback URL and calls
Network.getCookies— this is necessary becauserqh=1in the signed URL requires session cookies that are tied to the videoplayback origin - Downloads 8 parallel chunks via curl with exact browser headers (Referer = URL itself, matching User-Agent and sec-ch-ua from live browser)
- Assembles chunks in order into the output file
Key technical findings (learned 2026-03-18)
canDownload: falseblocks the Drive API (alt=media), yt-dlp, and plain curl with any headers- The
workspacevideo-paendpoint returns a signed streaming URL that bypasses download restrictions — it's what the Drive web player uses internally - The signed URL has
rqh=1(required request hash) — blocks curl without the right cookies+headers - Critical: Referer must be the videoplayback URL itself — NOT
youtube.googleapis.com(common wrong assumption from other YouTube-based approaches) - No
x-client-dataororiginheaders needed — the browser doesn't send them for this endpoint - The
Network.getCookieson the videoplayback tab (same origin as the streaming server) returns the right cookies; Drive tab cookies are insufficient
After downloading
Pass the output file to the video-transcribe skill for transcription.