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.2.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.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yt_transcript-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 734364de697d348f9ddf74483eea1a04363adac0b59cf7750c02d8d21687654e
MD5 4c6a5a5b7e51c35db83a74693ba872ce
BLAKE2b-256 e575338d86ec132cf32bda19c123394235437c3e5fee1139ea111eb41e4d3a76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yt_transcript-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 744aa8772dedaf694f2f9a7abb4b967d1fe124bc401a76a3c80303e4cb7fc074
MD5 501c852648f09e5a1b0960f9d0f3c4ba
BLAKE2b-256 ba9ca0ed413e6a6bcaa13dc854555e5bd1bf6a92cd9ea7301e9074acc329edde

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