https://github.com/redraw/llm-fragments-youtube
https://github.com/redraw/llm-fragments-youtube
llm llm-fragments
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/redraw/llm-fragments-youtube
- Owner: redraw
- License: mit
- Created: 2025-06-14T00:47:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-14T18:00:19.000Z (about 1 year ago)
- Last Synced: 2025-09-01T06:13:46.567Z (11 months ago)
- Topics: llm, llm-fragments
- Language: Python
- Homepage:
- Size: 49.8 KB
- Stars: 32
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LLM YouTube Fragments Plugin
A plugin for [Simon Willison's LLM tool](https://github.com/simonw/llm) that adds a `youtube` fragment loader to download and use YouTube video subtitles in your prompts.
## Installation
1. Make sure you have the LLM tool installed:
```bash
pip install llm
```
2. Install this plugin:
```bash
llm install llm-fragments-youtube
```
This will automatically install all dependencies, including yt-dlp.
## Usage
You can use the `youtube` or `yt` fragment in your LLM prompts to include subtitles from YouTube videos:
```bash
# Using a YouTube video ID
llm -f youtube:dQw4w9WgXcQ "summarize this video"
# You can also use the shorter 'yt' prefix
llm -f yt:dQw4w9WgXcQ "summarize this video"
# Continue chatting
llm -c "at which minute do they talk about ..."
# Language can also be specified
llm -f youtube:es:dQw4w9WgXcQ "resume el video"
# Using a full YouTube URL
llm -f youtube:https://www.youtube.com/watch?v=dQw4w9WgXcQ "summarize video"
```
## Development
### Running Tests
To run the tests, first install the package with test dependencies:
```bash
pip install -e ".[test]"
```
Then run the tests using pytest:
```bash
pytest
```
## License
Beerware