Skip to main content

vq — video questions

Answer questions about YouTube videos using subtitles and an LLM.

vq fetches subtitles from a YouTube video, passes them to an LLM, and returns the answer — with live Markdown rendering in the terminal.

Requirements

vq shells out to two external CLIs that must be on your PATH:

  • yt-dlp — subtitle extraction and download (always required)
  • llm — LLM integration (required to answer questions; not needed for --text-only/--metadata)

vq checks these at startup and, if one is missing, prints the missing tool with an install hint and exits.

Install them as standalone tools (recommended, keeps your llm plugins/keys):

uv tool install yt-dlp
uv tool install llm

YouTube: keep yt-dlp current + JS runtime

Since 2026 YouTube requires yt-dlp to solve a JavaScript challenge, otherwise it returns a misleading This video is not available for videos that are perfectly fine. Two things are needed:

  1. A recent yt-dlp (older than ~90 days often breaks):

    uv tool upgrade yt-dlp   # or: pipx upgrade yt-dlp
    
  2. A JavaScript runtime (deno) plus the EJS challenge-solver script:

    curl -fsSL https://deno.land/install.sh | sh   # installs deno to ~/.deno/bin
    

    Then enable it once, globally, in ~/.config/yt-dlp/config:

    --js-runtimes deno:/home/YOU/.deno/bin/deno
    --remote-components ejs:github
    

    (--remote-components ejs:github lets yt-dlp fetch the challenge solver on demand. This affects every yt-dlp call on your machine, not just vq.)

If vq prints yt-dlp failed to fetch video info, run the failing URL through yt-dlp -j <URL> directly — vq now echoes yt-dlp's own error underneath, which tells you the real cause.

You also need uv to install vq itself:

curl -LsSf https://astral.sh/uv/install.sh | sh

LLM Configuration

Before first use, configure an API key for your preferred provider:

OpenAI:

llm keys set openai

Anthropic (Claude):

llm install llm-anthropic
llm keys set anthropic

For other providers, see the LLM plugins directory.

Installation

From PyPI (recommended) — the package is published as video-questions; the installed command is vq:

uv tool install video-questions
Alternatives (pipx / pip)
pipx install video-questions
# or, into the current environment:
pip install video-questions

Upgrade:

uv tool upgrade video-questions

Uninstall:

uv tool uninstall video-questions

From source:

git clone https://github.com/aborruso/video_questions.git
cd video_questions
make install     # uv tool install .
make dev         # editable dev environment
make uninstall

Verify Installation

make test

Or manually:

vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' --text-only | head -5

Usage

vq [OPTIONS] URL [QUESTION]

Arguments

Argument Description
URL YouTube URL (required). Supports standard, youtu.be, and Shorts URLs.
QUESTION Question to ask about the video. If omitted, switches to --text-only mode.

Options

Option Description
-p, --language TEXT Response language (e.g. Italian, French)
-t, --template TEXT LLM template name
-m, --model TEXT LLM model to use (e.g. gpt-4o, claude-3-5-sonnet-20241022)
--sub PATH Save subtitles to file
-o, --output PATH Save LLM response to file
-i, --chat After the answer, stay in an interactive follow-up session (continues via llm -c)
--no-cache Skip cache, re-download subtitles
--text-only Print subtitles and exit (no LLM)
--metadata Print video metadata as one JSONL line and exit (no transcript)
--debug Show debug info (system prompt and prompt preview)
-V, --version Show version and exit

Examples

# Ask a question about a video
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' 'What are the main topics?'

# Ask, then keep asking interactively about the same video (-i / --chat)
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' 'Give me a summary' -i

# Reply in Italian
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' 'What is this about?' -p Italian

# Use a specific model
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' 'Summarize this' -m claude-3-5-sonnet-20241022

# Use an LLM template
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' 'What is this about?' -t my_template

# Save subtitles to file
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' --sub subtitles.txt

# Save LLM response to file
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' 'Summarize this' -o response.md

# Print subtitles only (no LLM)
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' --text-only

# Force re-download (skip cache)
vq 'https://www.youtube.com/watch?v=OM6XIICm_qo' 'What changed?' --no-cache

Cache

Subtitles are cached in /tmp/qv_cache/ for 60 days.

# View cache
ls -lh /tmp/qv_cache/

# Clear all cache
rm -rf /tmp/qv_cache/

# Clear cache for a specific video
rm -f /tmp/qv_cache/VIDEO_ID.txt /tmp/qv_cache/VIDEO_ID.title.txt

Use --no-cache to force a fresh download without clearing the cache.

Metadata

Release files for video-questions 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for video-questions 0.2.2
File Size Uploaded
video_questions-0.2.2.tar.gz 40.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for video-questions 0.2.2
File Interpreter ABI Platform
video_questions-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 51.1 kB

Release files / video_questions-0.2.2.tar.gz

Download URL video_questions-0.2.2.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b1e997400fdb97ab46c30719f646296b642c430d23464845b69ba84065ddf479
BLAKE2b-256 checksum
How to use checksums
dc89719b72896e3711c18b8e699c3d347894dbc06c384c591b2c79c9511ad5a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / video_questions-0.2.2-py3-none-any.whl

Download URL video_questions-0.2.2-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9047a2618cc82fed839cb3b98305298c46149c106b9e01888e8c976b6629761d
BLAKE2b-256 checksum
How to use checksums
f67ba7cf7ed02daa640024c0484c8e43b507fb68cc2622201ac5d4108adb4b34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page