Skip to main content

Make YouTube transcripts available to llm

Project description

llm-tools-yt-transcript

PyPI Changelog Tests License

Makes YouTube transcripts available to LLM

This is useful for generating a quick overview of a YouTube video before deciding to watch it

Note: this uses the youtube-transcript-api library with this caveat:

This code uses an undocumented part of the YouTube API, which is called by the YouTube web-client. So there is no guarantee that it won't stop working tomorrow, if they change how things work. I will however do my best to make things working again as soon as possible if that happens. So if it stops working, let me know!

Installation

Install this plugin in the same environment as LLM.

llm install llm-tools-yt-transcript

Usage

To use this with the LLM command-line tool:

# basic example
llm --tool yt_transcript "summarize this video: https://www.youtube.com/watch?v=kaMKInkV7Vs"  --tools-debug

# a more sophisticated report
cat yt-digest-prompt-template.txt | llm --save yt-digest
llm -t yt-digest "https://www.youtube.com/watch?v=kaMKInkV7Vs" -T yt_transcript -x > example-report.html

With the LLM Python API:

import llm
from llm_tools_yt_transcript import yt_transcript

model = llm.get_model("gpt-4.1-mini")

result = model.chain(
    "Example prompt goes here",
    tools=[yt_transcript]
).text()

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-tools-yt-transcript
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

llm install -e '.[test]'

To run the tests:

python -m pytest

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

llm_tools_yt_transcript-0.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

llm_tools_yt_transcript-0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file llm_tools_yt_transcript-0.1.tar.gz.

File metadata

  • Download URL: llm_tools_yt_transcript-0.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_tools_yt_transcript-0.1.tar.gz
Algorithm Hash digest
SHA256 ea06f649dd38fd018729fe00c128fb5c957ac5c03bd0cb5458dca5b3bb5ceb49
MD5 8607be918d1262c874ba9d5db044c5a2
BLAKE2b-256 4219cb740f6bfe2ef339c72cec2b74f294db00717e7c922218af0c89466c69bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_yt_transcript-0.1.tar.gz:

Publisher: publish.yml on rupello/llm-tools-yt-transcript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_tools_yt_transcript-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_tools_yt_transcript-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5958be9675b03f759add2a9304dd178d52b703cfcb59f5643dc4734a88a8473
MD5 70e420b048ced4b4ae9fd5f9054c8487
BLAKE2b-256 b57cee74d9bc9aca1957154d4f19eb74867d964f18258b744adda463ade2b27c

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_yt_transcript-0.1-py3-none-any.whl:

Publisher: publish.yml on rupello/llm-tools-yt-transcript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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