Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 1.33 KB

README.md

File metadata and controls

35 lines (21 loc) · 1.33 KB

yt-summarize.sh

yt-summarize.sh is a Bash script that summarizes Youtube videos by extracting and processing subtitles.

Prerequisites

uv installed (docs)

OpenAI key set for llm tool with the command:

uvx llm keys set openai

Usage

./yt-summarize.sh https://youtube.com/watch?v=dQw4w9WgXcQ

The script will:

  1. Download English subtitles from the specified Youtube video using yt-dlp
  2. Remove timestamps and other non-essential information
  3. Strip the text to fit the token limit using ttok
  4. Summarize the subtitles into a bullet list using OpenAI API and Simon Willison's great llm tool.

Advanced usage

You can add yt-dlp options to the end of the command, or create a persistent config file. Especially useful options:

--cookies-from-browser ... # try `chrome` or `safari` as a value
--sub-langs ...            # set to your preferred language

To change the prompt, set YT_SUMMARIZE_PROMPT environment variable. Example:

export YT_SUMMARIZE_PROMPT="summarize video transcript in 2 paragraphs"
./yt-summarize.sh ...