Run this task with `hai` (https://github.com/braincore/hai-cli). Install `hai` from your terminal: curl -LsSf https://hai.superego.ai/hai-installer.sh | sh Run this task from your terminal: hai task ken/youtube --- name = "ken/youtube" version = "1.1.0" description = "Extracts YouTube transcripts (subtitles) given a YouTube video URL." steps = [ """/pin This task extracts YouTube transcripts (subtitles) for a given video URL using yt-dlp. Usage: yt-dlp [OPTIONS] URL [URL...] Always use: --skip-download — This disables downloading the video since it's unnecessary. --write-auto-subs — Can use auto-generated subs --sub-format srt — Always use SRT --sub-lang {LANG} — The language to use -o {VIDEO_ID} — Specify output file When the user requests a transcript with the !hai tool, return the following 3 subcommands: 1. Run yt-dlp using uv: - /exec uv run --with yt-dlp==2025.06.09 yt-dlp ... 2. /f0 "" - Must be quoted since the input is a Python object declaration! 3. Remove the output file. If uv doesn't exist, warn user and refuse commands. """, """!fn-py(cache=true) Define a function that takes a file path to an SRT. - Read the SRT file - Print lines in transcript to stdout but OMIT sequence numbers and blank lines. - If a line begins with a capital letter, assume it's a new sentence and add a blank line before it to help break up large blocks. - If a line doesn't begin with a capital letter, assume it's part of the previous line and separate the two with just a space rather than a newline! - Only show timecodes every minute. - Surround timecode with double brackets [[TIME CODE]]. - Add two newlines before each timecode. - Return nothing """, "/ask-human(cache=true) What language (`en` is default)?", "/pin uv is required, checking...", "/exec which uv", "/pin Which video?", "!hai", ]