All skills
jimliu avatar

/baoyu-youtube-transcript

@09ce803 official
by Jim Liu 宝玉jimliu/baoyu-skills26k stars
2,896

Downloads YouTube video transcripts/subtitles and cover images by URL or video ID. Supports multiple languages, translation, chapters, and speaker identification. Caches raw data for fast re-formatting. Use when user asks to "get YouTube transcript", "download subtitles", "get captions", "YouTube字幕", "YouTube封面", "视频封面", "video thumbnail", "video cover image", or provides a YouTube URL and wants the transcript/subtitle text or cover image extracted.

Use this Skill: https://skilld.dev/gh/jimliu/baoyu-skills/baoyu-youtube-transcript

This session only. Nothing lands on disk.

promptsspeaker-transcript.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Speaker & Chapter Transcript Processing

You are an expert transcript specialist. Process the raw transcript file (with YAML frontmatter metadata and SRT-formatted transcript) into a structured, verbatim transcript with speaker identification and chapter segmentation.

Output Structure

Produce a single cohesive markdown file containing:

  1. YAML frontmatter (keep the original frontmatter from the raw file, which includes description)
  2. # Title heading (from frontmatter title)
  3. Description/summary paragraph (from frontmatter description)
  4. Table of Contents
  5. Cover image (if cover exists in frontmatter): ![cover](imgs/cover.jpg) — right after the ToC
  6. Full chapter-segmented transcript with speaker labels

Use the same language as the transcription for the title and ToC.

Rules

Transcription Fidelity

  • Preserve every spoken word exactly, including filler words (um, uh, like) and stutters
  • NEVER translate. If the audio mixes languages (e.g., "这个 feature 很酷"), replicate that mix exactly

Speaker Identification

  • Priority 1: Use metadata. Analyze the video's title, channel name, and description to identify speakers
  • Priority 2: Use transcript content. Look for introductions, how speakers address each other, contextual cues
  • Fallback: Use consistent generic labels (**Speaker 1:**, **Host:**, etc.)
  • Consistency: If a speaker's name is revealed later, update ALL previous labels for that speaker

Chapter Generation

  • If the raw file contains a # Chapters section, use those as the primary basis for segmenting
  • Otherwise, create chapters based on significant topic shifts in the conversation

Input Format

  • The # Transcript section contains SRT-formatted subtitles with pre-computed start/end timestamps
  • Each SRT block has: sequence number, HH:MM:SS,mmm --> HH:MM:SS,mmm timestamp line, and text
  • Use the SRT timestamps directly — no need to calculate paragraph start/end times, just merge adjacent blocks

Formatting

Timestamps: Use [HH:MM:SS → HH:MM:SS] format (start → end) at the end of each paragraph. No milliseconds.

Table of Contents:

## Table of Contents
* [HH:MM:SS] Chapter Title

Chapters:

## Chapter Title [HH:MM:SS]

Two blank lines between chapters.

Dialogue Paragraphs:

  • First paragraph of a speaker's turn starts with **Speaker Name:**
  • Split long monologues into 2-4 sentence paragraphs separated by blank lines
  • Subsequent paragraphs from the SAME speaker do NOT repeat the speaker label
  • Every paragraph ends with exactly ONE timestamp range [HH:MM:SS → HH:MM:SS]

Correct example:

**Jane Doe:** The study focuses on long-term effects of dietary changes. We tracked two groups over five years. [00:00:15 → 00:00:21]

The first group followed the new regimen, while the second group maintained a traditional diet. [00:00:21 → 00:00:28]

**Host:** Fascinating. And what did you find? [00:00:28 → 00:00:31]

Wrong (multiple timestamps in one paragraph):

**Host:** Welcome back. [00:00:01] Today we have a guest. [00:00:02]

Non-Speech Audio: On its own line: [Laughter] [HH:MM:SS]

Example Output

---
title: "Example Interview"
channel: "The Show"
date: 2024-04-15
url: "https://www.youtube.com/watch?v=xxx"
cover: imgs/cover.jpg
description: "Jane Doe discusses her groundbreaking five-year study on the long-term effects of dietary changes."
language: en
---

# Example Interview

Jane Doe discusses her groundbreaking five-year study on the long-term effects of dietary changes.

## Table of Contents
* [00:00:00] Introduction and Welcome
* [00:00:12] Overview of the New Research

![cover](imgs/cover.jpg)


## Introduction and Welcome [00:00:00]

**Host:** Welcome back to the show. Today, we have a, uh, very special guest, Jane Doe. [00:00:00 → 00:00:03]

**Jane Doe:** Thank you for having me. I'm excited to be here and discuss the findings. [00:00:03 → 00:00:07]


## Overview of the New Research [00:00:12]

**Host:** So, Jane, before we get into the nitty-gritty, could you, you know, give us a brief overview for our audience? [00:00:12 → 00:00:16]

**Jane Doe:** Of course. The study focuses on the long-term effects of specific dietary changes. It's a bit complicated but essentially we tracked two large groups over a five-year period. [00:00:16 → 00:00:23]

The first group followed the new regimen, while the second group, our control, maintained a traditional diet. This allowed us to isolate variables effectively. [00:00:23 → 00:00:30]

[Laughter] [00:00:30]

**Host:** Fascinating. And what did you find? [00:00:31 → 00:00:33]

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill downloads YouTube transcripts and metadata using YouTube's InnerTube API and yt-dlp. It includes a specific prompt for AI-powered speaker identification. While it processes external data from YouTube which could theoretically contain malicious instructions (indirect prompt injection), it follows standard practices for data processing and caching.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: MEDIUM · 1 issue

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 09ce803. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 6 months ago
version
1.1.0
Other metadata
metadata
{
  "openclaw": {
    "homepage": "https://github.com/JimLiu/baoyu-skills#baoyu-youtube-transcript",
    "requires": {
      "anyBins": [
        "bun",
        "npx"
      ]
    }
  }
}
  • TypeScript
  • youtube
  • transcripts
  • subtitles
  • captions
  • video-metadata
  • yt-dlp
  • multilingual

README badge

README badge for jimliu/baoyu-skills/baoyu-youtube-transcript

Downloads YouTube video transcripts, subtitles, and cover images by URL or video ID, with support for multiple languages, translation, chapter segmentation, and speaker identification. Caches raw data for fast re-formatting and falls back to yt-dlp when YouTube blocks direct API access.

Generated from the current SKILL.md.

Does this skill require a YouTube API key?
No. The skill uses YouTube's InnerTube API directly and falls back to yt-dlp when YouTube blocks the direct API path, so no API key is needed.
What languages and formats does this support?
Supports multiple languages (specified by language code, defaulting to English), translation to other languages, and output in markdown with timestamps or SRT subtitle format.
Does this cache transcripts?
Yes. On first fetch, the skill caches raw transcript data, sentence-segmented transcript, video metadata, and cover image. Subsequent runs for the same video reuse cached data unless --refresh is used.
Can this identify speakers in a transcript?
The --speakers option outputs raw transcript data with metadata for AI post-processing. Speaker identification requires a follow-up step: the skill includes a prompt template to guide an AI agent in labeling speakers based on video title, channel, and description.
What happens if YouTube blocks the request?
The skill retries with alternate client identities and then falls back to yt-dlp if available. If yt-dlp is unavailable and all retries fail, the agent must resolve the tooling itself.

Generated from the current SKILL.md. These answers refresh after source changes.