Plugin for LLM that adds support for fetching transcripts from YouTube videos using Supadata API
Project description
llm-youtube-transcript
LLM plugin for fetching YouTube video transcripts.
This plugin fetches the text transcript of a YouTube video using the Supadata API and makes it available as an LLM fragment.
For background on LLM fragments:
Installation
Install this plugin in the same environment as LLM.
llm install llm-youtube-transcript
Configuration
This plugin requires a Supadata API key to function. You get 100 requests per month with a free acount.
-
Sign up at Supadata.ai and get your API key.
-
Set the API key as an environment variable named
SUPADATA_API_KEY:export SUPADATA_API_KEY=your_api_key_here
You can add this line to your shell profile (e.g.,
~/.bashrc,~/.zshrc) to make it persistent across sessions.
Usage
You can feed the transcript of a YouTube video into LLM using the yt: fragment prefix followed by the video URL.
Make sure you have set the SUPADATA_API_KEY environment variable first.
Note: If your YouTube URL contains special characters (like ? or &), you must enclose the entire fragment identifier (e.g., yt:https://...) in single or double quotes on the command line. This prevents your shell from misinterpreting the URL.
For example:
# Fetch transcript from a YouTube video URL (note the quotes)
llm -f 'yt:https://www.youtube.com/watch?v=dQw4w9WgXcQ' 'Summarize this transcript'
# Example with a different video
llm -f 'yt:https://www.youtube.com/watch?v=VIDEO_ID_HERE' 'What are the main points discussed in this video?'
The plugin will call the Supadata API to retrieve the plain text transcript of the specified video. If the API key is missing or invalid, or if the transcript cannot be fetched, an error will be raised.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-youtube-transcript
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
# Installs llm, httpx, and testing tools like pytest
pip install -e '.[test]'
To run the tests:
python -m pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_youtube_transcript-0.1.tar.gz.
File metadata
- Download URL: llm_youtube_transcript-0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0fb2f5f9a5d11f80d77ca0f97b923648b4af647e522ced6563b6efa63ad285f
|
|
| MD5 |
531159b25b129e24e23731f06cadc3bf
|
|
| BLAKE2b-256 |
d066c02d267133c956dbada07604db653be002bc12917cf98a8fd32576479872
|
Provenance
The following attestation bundles were made for llm_youtube_transcript-0.1.tar.gz:
Publisher:
publish.yaml on saeedesmaili/llm-youtube-transcript
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_youtube_transcript-0.1.tar.gz -
Subject digest:
f0fb2f5f9a5d11f80d77ca0f97b923648b4af647e522ced6563b6efa63ad285f - Sigstore transparency entry: 198237455
- Sigstore integration time:
-
Permalink:
saeedesmaili/llm-youtube-transcript@31588c6de8297da41b9f3c28fec471ae149a6940 -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/saeedesmaili
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@31588c6de8297da41b9f3c28fec471ae149a6940 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_youtube_transcript-0.1-py3-none-any.whl.
File metadata
- Download URL: llm_youtube_transcript-0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e65b23ec1e6dd9750eb77d7e2f2960b1d6120ba1ce498df9b220b321bcaebb1a
|
|
| MD5 |
2016326a33f3ef098528ff484d523012
|
|
| BLAKE2b-256 |
ef94833ef31c46ac66acd596fd70d637b804bd1a715438c5b2c77464ed9c3e89
|
Provenance
The following attestation bundles were made for llm_youtube_transcript-0.1-py3-none-any.whl:
Publisher:
publish.yaml on saeedesmaili/llm-youtube-transcript
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_youtube_transcript-0.1-py3-none-any.whl -
Subject digest:
e65b23ec1e6dd9750eb77d7e2f2960b1d6120ba1ce498df9b220b321bcaebb1a - Sigstore transparency entry: 198237458
- Sigstore integration time:
-
Permalink:
saeedesmaili/llm-youtube-transcript@31588c6de8297da41b9f3c28fec471ae149a6940 -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/saeedesmaili
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@31588c6de8297da41b9f3c28fec471ae149a6940 -
Trigger Event:
release
-
Statement type: