Skip to main content

Generate structured notes from YouTube/Bilibili videos using local or online LLMs

Project description

silentir

The silentir project generates structured notes from YouTube and Bilibili URLs using local (Ollama) or online (OpenAI-compatible) models.

Install

uv sync

Optional ASR dependencies:

uv sync --extra asr

Optional example dependencies (examples/basic_usage.py):

uv sync --extra examples

Optional Streamlit UI dependencies:

uv sync --extra ui

Install dev/test dependencies:

uv sync --group dev

Quickstart

uv run silentir "https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
  --provider-policy local_first \
  --output-format markdown \
  --include-timestamps section \
  --out notes.md

Transcript-only mode

Extract the raw video transcript without LLM summarization:

uv run silentir "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --transcript-only

Output format: [HH:MM:SS] segment text per line, one segment per line. No model configuration is needed in this mode — it skips the entire provider pipeline.

Python API

from silentir import generate_notes

result = generate_notes(
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    language="auto",
    provider_policy="local_first",
    local_model="qwen2.5:7b-instruct",
    online_model="gpt-4.1-mini",
    ollama_host="http://localhost:11434",
    openai_base_url="https://api.openai.com/v1",
    openai_api_key=None,
)
print(result.note_markdown)

# Transcript-only (no model needed):
transcript = generate_notes(
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    transcript_only=True,
)
print(transcript.note_markdown)  # [HH:MM:SS] segment text

Run tests:

uv run pytest

Lint And Format

Install Git hooks:

uv run pre-commit install

Run checks manually:

uv run pre-commit run --all-files
uv run ruff check .
uv run ruff format .

Architecture and pipeline details:

  • docs/architecture.md

Explicit Configuration

All runtime configuration is explicit. Use CLI flags or Python function arguments instead of environment variables.

Notes

  • Subtitle-first transcription is used by default.
  • If subtitles are unavailable, ASR transcriber fallback is used.
  • Runtime provider fallback follows provider_policy.

Bilibili Subtitles (Optional)

For Bilibili URLs, subtitle extraction prefers bilibili-cli (bili) when available, because Bilibili subtitles require authentication and use a private format that yt-dlp cannot reliably fetch. If bili is missing or fails, silentir automatically falls back to yt-dlp.

Install and authenticate (one time):

uv tool install bilibili-cli
bili login   # QR login, or auto-uses browser cookies

Control the backend explicitly with --bilibili-backend:

  • auto (default): try bili, fall back to yt-dlp
  • bili: use bili only; fail if unavailable
  • ytdlp: use yt-dlp only, skip bili

bili uses its own credential store (~/.bilibili-cli/). The --cookies flag applies only to the yt-dlp fallback path.

Streamlit UI

Run the web UI:

uv run --extra ui,asr streamlit run examples/basic_ui.py

The UI exposes the same configuration options as the CLI and lets you preview and download generated notes. You can also provide an optional write path to persist the rendered notes directly to a file.

Skill

silentir ships an agent skill so Claude Code (and other runtimes that read ~/.agents/skills/) can call it via a slash command.

Auto-detection: When invoked from inside a CLI coding agent (Claude Code, Codex, OpenCode), the skill automatically switches to transcript-only mode and delegates LLM summarization to the calling agent. No manual --agent flag is required — detection is via inherited environment variables (CLAUDECODE, CODEX_*, OPENCODE).

Quick install

# Install as `/silentir` (default)
bash scripts/install-skill.sh

# Install under a custom slash-command name
bash scripts/install-skill.sh --name video-notes
# -> /video-notes source="<URL or local file path>"

# Development mode: symlink instead of copy
bash scripts/install-skill.sh --symlink

# Remove an install
bash scripts/install-skill.sh --uninstall --name video-notes

The script copies (or symlinks) the skill into ~/.agents/skills/<name>/ and creates a ~/.claude/skills/<name> symlink. The installed SKILL.md's name: field is rewritten when you pass --name so the slash command matches. bash scripts/install-skill.sh --help lists every flag. Override AGENTS_SKILLS_DIR / CLAUDE_SKILLS_DIR env vars to target a non-default location.

Requirements

  • uvx on $PATH (install uv). The handler launches the published silentir[asr] package from PyPI; no local checkout is needed.
  • Optional env defaults: LOCAL_MODEL, ONLINE_MODEL, OPENAI_BASE_URL, OPENAI_API_KEY.

Skill files:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

silentir-0.3.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

silentir-0.3.0-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file silentir-0.3.0.tar.gz.

File metadata

  • Download URL: silentir-0.3.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for silentir-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d4c6e62c66cefac56a4c04307735950ac5b62488839e6b0bef99e2b6b8134e16
MD5 4fc69b2b072428a84bf67333026ad0c6
BLAKE2b-256 9686298f6b79729cacf0c2443cce01ad15abce70bba4997a8cb5f08a116f1206

See more details on using hashes here.

File details

Details for the file silentir-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: silentir-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for silentir-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 369463e4f58033cbdd1f652b6486f8e4c2eb4510163833c42f4b42da7084181b
MD5 0ac671673664766024b92455f08cbd52
BLAKE2b-256 40fdc311647a27568f281591d31f19aff7b7d6647ddbedc1a62667eb725d6eba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page