Automatically summarize YouTube videos and deliver them as email digests.
Subscribe to your favorite YouTube channels, and get daily email summaries powered by any OpenAI-compatible LLM (OpenAI, local models via Ollama/vLLM/llama.cpp, Anthropic, etc.). Read video content in 5 minutes instead of watching for 20. Self-hosted, privacy-friendly, and fully configurable.
git clone https://github.com/apond308/youtube-digest.git
cd youtube-digest
./install.shThe installer walks you through everything interactively:
- Creates a Python virtualenv and installs dependencies
- Prompts for your API keys (OpenAI-compatible LLM, Gmail)
- Sets up your channel list and subscriber config
- Optionally installs as a systemd service and/or Cloudflare tunnel
After setup, run the server:
source .venv/bin/activate
youtube-digest serveOr run a one-off batch digest:
source .venv/bin/activate
youtube-digest runDaily digest flow:
- Fetches RSS feeds from all configured YouTube channels
- For each subscriber, filters to their channels and skips already-sent videos
- Fetches the transcript, sends it to an LLM for summarization
- Archives the markdown summary locally and emails the HTML digest
- Tracks deliveries in SQLite to prevent duplicates
On-demand flow:
- Open the web UI at
http://localhost:4000 - Paste any YouTube URL and pick a subscriber
- Summary is generated in the background and emailed when ready
All user configuration lives in three files (created by the installer):
| File | Purpose |
|---|---|
.env |
API keys and credentials |
channels.yaml |
YouTube channels to follow |
subscribers.yaml |
Email subscribers and their channel preferences |
See .env.example, channels.example.yaml, and subscribers.example.yaml for annotated templates.
| Variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
API key for your LLM provider | (required) |
OPENAI_BASE_URL |
OpenAI-compatible API base URL | https://api.openai.com/v1 |
MODEL_NAME |
Model to use for summarization | gpt-4o-mini |
GMAIL_ADDRESS |
Gmail address for sending digests | (required) |
GMAIL_APP_PASSWORD |
Gmail app password (create one here) | (required) |
MAX_VIDEOS_PER_DAY |
Global max videos per subscriber per run | 0 (no limit) |
Any OpenAI-compatible API works -- OpenAI, local LLMs via llama.cpp/vLLM/Ollama, Anthropic via a proxy, etc.
youtube-digest run # run one digest cycle
youtube-digest serve # start the web server + daily scheduler
youtube-digest serve --port 9000 # custom port
youtube-digest serve --reload # auto-reload for developmentIn server mode, APScheduler runs the daily digest automatically at 05:00 America/Los_Angeles.
| Method | Path | Description |
|---|---|---|
GET |
/ |
Web form for on-demand video submission |
POST |
/api/summarize |
Queue a video: {"url": "...", "subscriber_email": "..."} |
GET |
/api/health |
Health check: {"status": "ok"} |
For production deployment options (systemd service, Cloudflare tunnel, reverse proxy), see docs/DEPLOYMENT.md.
youtube-digest/
├── install.sh # interactive installer
├── .env.example # env var template
├── channels.example.yaml # channel config template
├── subscribers.example.yaml # subscriber config template
├── pyproject.toml
├── deploy/templates/ # systemd + cloudflare templates
├── docs/DEPLOYMENT.md
├── templates/ # Jinja2 email + web templates
│ ├── email.html
│ └── form.html
└── youtube_digest/ # Python package
├── __main__.py # CLI entry point
├── config.py # settings + channel loading
├── models.py # data models
├── pipeline.py # orchestration logic
├── server.py # FastAPI app + scheduler
├── services/
│ ├── feed.py # RSS feed fetching
│ ├── transcript.py # YouTube transcript retrieval
│ └── summarizer.py # LLM summarization
├── delivery/
│ └── email.py # Gmail SMTP delivery
└── storage/
├── archive.py # markdown archive of summaries
├── database.py # SQLite sent-video tracking
└── subscribers.py # subscriber YAML loading
| Package | Purpose |
|---|---|
openai |
OpenAI-compatible LLM client |
youtube-transcript-api |
Transcript retrieval |
feedparser |
RSS/Atom feed parsing |
requests |
HTTP requests |
jinja2 |
HTML template rendering |
markdown |
Markdown to HTML conversion |
python-dotenv |
.env file loading |
pyyaml |
YAML config parsing |
fastapi |
Web server framework |
uvicorn |
ASGI server |
apscheduler |
Scheduled daily digest |