Summarize YouTube videos, local audio/video files, or existing text transcripts.
youtube_transcript_apito fetch YouTube captions (en / fr).whispertranscription for local media (ffmpeg-pythonfor audio extraction).- Optional speaker diarization via
pyannote-audio. textblobsentiment/polarity.- OpenAI API summary (
--with_openai) or local RAG summary vialangchain+langchain-ollama+chromadb(default, usesmistral). - Markdown-formatted summary output.
uv run main.py <youtube_url | path/to/file> [options]Examples:
uv run main.py https://www.youtube.com/watch?v=VIDEO_ID --summarize --with_openai
uv run main.py ./my_meeting.mp4 --diarize --summarize
uv run main.py ./existing_transcript.txt --summarize| Flag | Description |
|---|---|
-l, --language |
en or fr (default: en). Ignored for local media (auto-detected). |
--diarize |
Identify speakers when transcribing local media (default: False). |
-s, --summarize |
Produce a summary (default: False). |
--with_openai |
Summarize via OpenAI API instead of local RAG (default: False). |
-d, --debug |
Enable DEBUG-level logging (default: False). |
Runtime settings live in my_settings.py (Settings.from_env() reads .env + os.environ). Copy .env.example to .env and add:
LOG_LEVEL=INFO
OPENAI_API_KEY=sk-... # only required for --with_openai
.env is gitignored.
Configured via logger_config.yaml. Handlers:
| Handler | Stream | Level |
|---|---|---|
| stdout | stdout | INFO/DEBUG (non-errors) |
| stderr | stderr | WARNING+ |
| file | logs/yt-summary.log |
DEBUG+ (rotating) |
Uncomment - json_file under root.handlers in logger_config.yaml to also emit structured JSON to logs/yt-summary.jsonl. Uncaught exceptions are routed through the logger via install_excepthook().
All quality commands run through just:
| Command | Does |
|---|---|
just |
List recipes |
just lint |
ruff check + ruff format --check |
just format |
ruff format + ruff check --fix |
just typecheck |
uv run pyright |
just test |
uv run pytest |
just all |
lint + typecheck + test |
Install the pre-commit gate once per clone:
uv run pre-commit installgit commit will then run ruff + pyright + pytest on staged Python files.
See TODO.md.