Chrome extension + native helper that adds clipping controls directly under every YouTube video and downloads the requested segment via yt-dlp + ffmpeg.
- Use the Use current time buttons to populate start/end.
- Adjust the clip name or timestamps manually (supports
HH:MM:SS.mmm). - Click Download clip. The background script forwards the request to
native_helper.pyvia Chrome Native Messaging. - The helper downloads + trims using
yt-dlpand saves the media + JSON metadata to~/Downloads/YouTube Clips(folder is auto-created). - Once complete, click Reveal clip to show it in Finder/Explorer (delegated to the helper).
extension/– Manifest v3 extension (content script UI + background service worker).helper/native_helper.py– Native messaging helper that callsyt-dlpand trims the requested range.helper/yt_snippet_helper.json– Native messaging host manifest template (installer fills in the helper path + extension ID).helper/install_helper.py– Optional installer script to verify dependencies and copy the host manifest.plan.md– High-level implementation rationale.
- Chrome/Chromium 114+ (Manifest v3 compatible).
- macOS/Linux/Windows with Python 3.9+,
yt-dlp, andffmpeginPATH.
Install helper dependencies:
cd helper
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtVerify that ffmpeg is available (e.g., via Homebrew brew install ffmpeg).
The repository no longer checks in a private RSA key. This keeps the signed extension ID private (as required for security) and lets each distribution define its own ID:
- Load the unpacked extension via
chrome://extensions. - Copy the ID that Chrome assigns (e.g.
abc123...) from the card’s ID field. - Run the installer with that ID so the native host only accepts messages from your build:
python3 helper/install_helper.py --extension-id <your-extension-id>When the project is published to the Chrome Web Store, its official extension ID can be documented in the release notes, and users should pass that ID to the installer. Until then, each developer repeats the steps above after loading the extension locally.
The installer script:
- Verifies
python3,yt-dlp, andffmpegexist inPATH. - Writes the host manifest to the Chrome/Chromium native messaging directory (platform-aware).
- Ensures
native_helper.pyis executable. - On Windows, writes the
HKEY_CURRENT_USER\SOFTWARE\{Google\Chrome|Chromium}\NativeMessagingHosts\yt_snippet_helperregistry entry so Chrome actually discovers the manifest. - If
yt-dlp/ffmpeglive in a common Homebrew location (e.g.,/opt/homebrew/bin) but aren’t on your PATH, the script will still detect them and print a reminder to export that directory.
Useful flags:
--chrome-channel chromiuminstalls into the Chromium profile paths.--dry-runprints the manifest without writing.--skip-dependency-checkskips verifyingyt-dlp/ffmpeg(useful if they’re installed but not on the current PATH).
Linux: the manifest is placed in ${XDG_CONFIG_HOME:-~/.config}/google-chrome/NativeMessagingHosts/.
Windows: the installer records the manifest path under HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\NativeMessagingHosts (Chrome docs).
- Run
pnpm/viteis not required – this is pure JS/CSS. - Open
chrome://extensions, toggle Developer mode, and click Load unpacked. - Select the
extension/directory from this repo. Chrome will assign an ID (shown on the card); copy it for the installer step. - Navigate to any
youtube.com/watchpage. A “Clip Recorder” panel should appear under the video player.
- “Native helper not found” – confirm that the host manifest exists in the Chrome Native Messaging directory and that the
pathis correct. yt-dlperrors – run the same command manually (printed in helper logs) to validate network/DRM limitations.- Permission errors – the extension requires
nativeMessaging,downloads, and host permission forhttps://www.youtube.com/*permanifest.json. - Helper not registering – rerun
python3 helper/install_helper.py --extension-id <your-extension-id>and restart Chrome.
This project is released under the MIT License.
