A browser extension and local backend system that automatically archives YouTube videos when visited. The system consists of a Firefox extension that detects YouTube video pages and a Go backend that downloads the videos using yt-dlp.
- HTTP Server (
main.go): Runs on port 3009 with two endpoints:/: Basic health check endpoint/youtube: POST endpoint that accepts video IDs and triggers downloads
- Video Downloader (
youtube.go): Uses yt-dlp and ffmpeg to download YouTube videos and convert them to MOV format with h264_videotoolbox encoding - Subtitle Support: Downloads English subtitles in VTT format (currently disabled in retry loop)
- Manifest (
manifest.json): Defines extension permissions and structure - Content Script (
content.js): Automatically detects YouTube video pages and extracts video IDs from URLs - Background Script (
background.js): Handles communication between content script and backend API - Popup Interface (
popup.html/js): Provides a simple UI for manual data fetching
- When you visit a YouTube video page, the content script automatically detects the video ID from the URL
- The video ID is sent to the background script, which makes a POST request to
http://localhost:3009/youtube - The Go backend receives the video ID and uses yt-dlp to download the video
- Videos are saved to the
./data/directory and converted to MOV format using ffmpeg with hardware acceleration - The system also supports subtitle downloading (though currently limited to 1 attempt)
- Start the Go backend:
go run . - Load the Firefox extension from the
firefox/directory - Visit any YouTube video page to automatically trigger archiving
- yt-dlp: For downloading YouTube videos
- ffmpeg: For video format conversion and processing
- Go: Backend server runtime
Not associated with https://www.starchive.io/