Skip to content

haron/yt-summarize.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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 ...

About

Summarize Youtube video with a Bash/shell script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages