gptme-youtube

Let [gptme](https://gptme.org) read YouTube videos: fetch a video's transcript from a URL or video ID, and summarize it with the cheaper summary model of your configured provider. plugins/gptme-youtube View on GitHub

gptme-youtube

Let gptme read YouTube videos: fetch a video's transcript from a URL or video ID, and summarize it with the cheaper summary model of your configured provider.

Status: experimental. This was previously a built-in gptme tool (tools/youtube.py) and now lives here as a plugin.

Install

Install into the same Python environment as gptme, including the youtube extra (which pulls in youtube-transcript-api). The package registers itself through the gptme.plugins entry point:

pip install "gptme-youtube[youtube] @ git+https://github.com/gptme/gptme-contrib#subdirectory=plugins/gptme-youtube"
# or, for a pipx-installed gptme:
pipx inject gptme "gptme-youtube[youtube] @ git+https://github.com/gptme/gptme-contrib#subdirectory=plugins/gptme-youtube"

Alternatively, add the plugin directory to gptme.toml and install youtube-transcript-api into gptme's environment yourself:

[plugins]
paths = ["/path/to/gptme-contrib/plugins/gptme-youtube"]
enabled = ["gptme_youtube"]

The youtube tool only becomes available when youtube-transcript-api can be imported.

Quickstart

gptme "summarize https://www.youtube.com/watch?v=dQw4w9WgXcQ"

The agent can call the tool's functions from a Python block:

transcript = get_transcript("https://youtu.be/dQw4w9WgXcQ")
print(summarize_transcript(transcript))

or fetch a transcript with a youtube block containing a URL or video ID:

```youtube
dQw4w9WgXcQ
```

Functions

Transcripts come from YouTube's caption data, so videos without captions (manual or auto-generated) can't be fetched.

Development

# from the gptme-contrib repo root
uv run pytest plugins/gptme-youtube/tests