Skip to main content

A command-line tool to fetch, cache, and summarize YouTube video transcripts

Project description

yt-transcript

A command-line tool to fetch, cache, and summarize YouTube video transcripts. Optionally generate AI-powered summaries.

Features

  • 📝 Fetch official or auto-generated YouTube transcripts
  • 💾 Cache transcripts locally to avoid repeated network calls
  • 🤖 Generate AI-powered summaries using OpenAI GPT
  • 🎯 Extract or generate chapter markers
  • 📋 Export to JSON or Markdown formats

Installation

pip install yt-transcript

Set OPENAI_API_KEY environment variable

export OPENAI_API_KEY=<your-openai-api-key>

Examples

Fetch transcript

yt-transcript https://www.youtube.com/watch?v=7xTGNNLPyMI

yt-transcript https://www.youtube.com/watch?v=IziXJt5iUHo

Fetch transcript and summarize (videos that have chapters)

yt-transcript https://www.youtube.com/watch?v=7xTGNNLPyMI --summarize --markdown

yt-transcript https://www.youtube.com/watch?v=IziXJt5iUHo --summarize --markdown

Fetch transcript and summarize (videos that don't have chapters)

yt-transcript https://www.youtube.com/watch?v=f0RbwrBcFmc&ab_channel=LangChain --summarize --markdown

Publish to PyPI

uv build
uv publish --token $PYPI_TOKEN

TODO

  • Add local Whisper transcription fallback if no transcript is available
  • Remove fetch keyword
  • Create dev and main branches. Add Github Action to test and publish to PyPi.

Project details


Download files

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

Source Distribution

yt_transcript-0.1.3.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

yt_transcript-0.1.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file yt_transcript-0.1.3.tar.gz.

File metadata

  • Download URL: yt_transcript-0.1.3.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for yt_transcript-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7d9b58363c1446378854f8d7892b353c762938cfa96171e30b66f9a1ae753d0e
MD5 6ef07ddc0a415c9a81d9fd0d0ce5437e
BLAKE2b-256 9819427ce29d3a14607a6e64becbe6c1ca26bc8f4d117536bb18ef5ef18f07d6

See more details on using hashes here.

File details

Details for the file yt_transcript-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for yt_transcript-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bdf4c0c3a93ab46a2fc249ef036d8ea1a400b768b0a3f9a623fcaffc56386610
MD5 343049c24b4c6775901217c3d52dd2d3
BLAKE2b-256 5bd5e7ff45256060e43af72623586f6dd9aefacd2394353febefe4222cb56a3d

See more details on using hashes here.

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