Communitygithub.com

ComeOnOliver/skillshub

从YouTube视频中提取转录文本,并使用智能分析框架生成全面、详细的摘要。

skillshub 是什么?

该技能专为需要从YouTube视频(如教育视频、讲座、教程或信息性内容)中提取深入内容和参考文档的用户设计。它首先验证视频的可用性,然后使用 `youtube-transcript-api` Python 库提取转录文本。核心功能是利用 STAR + R-I-S-E 框架生成结构化的详细摘要,包括执行摘要、逐节分解、关键见解、概念术语和结论。技能支持多种 YouTube URL 格式,并处理视频不可用、转录禁用等错误情况。它适用于 Claude Code、Cursor 或 Codex 等 AI 代码助手,通过明确的命令行步骤和进度跟踪,为用户提供完整的内容分析文档。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/sickn33/youtube-summarizer

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

youtube-summarizer

目的

该技能从 YouTube 视频中提取字幕,并使用 STAR + R-I-S-E 框架生成全面、详细的摘要。它会验证视频的可用性,使用 youtube-transcript-api Python 库提取字幕,并生成包含所有见解、论点和关键要点的详细文档。

该技能专为需要从教育视频、讲座、教程或信息性内容中进行深入内容分析和参考文档的用户设计。

使用时机

以下情况应使用此技能:

  • 用户提供 YouTube 视频 URL 并想要一个详细的摘要
  • 用户需要记录视频内容以便参考,而无需重新观看
  • 用户想要从教育内容中提取见解、关键点和论点
  • 用户需要从 YouTube 视频中获取字幕以进行分析
  • 用户要求“总结”、“摘要”或“提取内容”来自 YouTube 视频
  • 用户希望获得优先考虑完整性的全面文档,而非简洁性

步骤 0:发现与设置

在处理视频之前,验证环境和依赖项:

# 检查是否安装了 youtube-transcript-api
python3 -c "import youtube_transcript_api" 2>/dev/null
if [ $? -ne 0 ]; then
    echo "⚠️  未找到 youtube-transcript-api"
    # 提供安装选项
fi

# 检查 Python 是否可用
if ! command -v python3 &>/dev/null; then
    echo "❌ 需要 Python 3,但未安装"
    exit 1
fi

如果缺少依赖项,询问用户:

youtube-transcript-api 是必需的,但尚未安装。

是否现在安装?
- [ ] 是 - 使用 pip 安装 (pip install youtube-transcript-api)
- [ ] 否 - 我将手动安装

如果用户选择“是”:

pip install youtube-transcript-api

验证安装:

python3 -c "import youtube_transcript_api; print('✅ youtube-transcript-api 安装成功')"

主要工作流程

进度跟踪指南

在整个工作流程中,在每个步骤之前显示一个视觉进度条,以随时告知用户。进度条格式如下:

echo "[████░░░░░░░░░░░░░░░░] 20% - 步骤 1/5:验证 URL"

格式规范:

  • 20 个字符宽(使用 █ 表示已完成,░ 表示未完成)
  • 百分比增量:步骤 1=20%,步骤 2=40%,步骤 3=60%,步骤 4=80%,步骤 5=100%
  • 步骤计数器显示当前/总数(例如,“步骤 3/5”)
  • 当前阶段的简要描述

在步骤 1 之前显示初始状态框:

╔══════════════════════════════════════════════════════════════╗
║     📹 YOUTUBE 摘要生成器 - 处理视频                         ║
╠══════════════════════════════════════════════════════════════╣
║ → 步骤 1:验证 URL                   [进行中]                ║
║ ○ 步骤 2:检查可用性                                        ║
║ ○ 步骤 3:提取字幕                                          ║
║ ○ 步骤 4:生成摘要                                          ║
║ ○ 步骤 5:格式化输出                                        ║
╠══════════════════════════════════════════════════════════════╣
║ 进度:██████░░░░░░░░░░░░░░░░░░░░░░░░  20%                   ║
╚══════════════════════════════════════════════════════════════╝

步骤 1:验证 YouTube URL

目标: 提取视频 ID 并验证 URL 格式。

支持的 URL 格式:

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID
  • https://m.youtube.com/watch?v=VIDEO_ID

操作:

# 使用正则表达式或 URL 解析提取视频 ID
URL="$USER_PROVIDED_URL"

# 模式 1:youtube.com/watch?v=VIDEO_ID
if echo "$URL" | grep -qE 'youtube\.com/watch\?v='; then
    VIDEO_ID=$(echo "$URL" | sed -E 's/.*[?&]v=([^&]+).*/\1/')
# 模式 2:youtu.be/VIDEO_ID  
elif echo "$URL" | grep -qE 'youtu\.be/'; then
    VIDEO_ID=$(echo "$URL" | sed -E 's/.*youtu\.be\/([^?]+).*/\1/')
else
    echo "❌ 无效的 YouTube URL 格式"
    exit 1
fi

echo "📹 视频 ID 已提取:$VIDEO_ID"

如果 URL 无效:

❌ 无效的 YouTube URL

请提供以下格式之一的有效 YouTube URL:
- https://www.youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID

示例:https://www.youtube.com/watch?v=dQw4w9WgXcQ

步骤 2:检查视频和字幕可用性

进度:

echo "[████████░░░░░░░░░░░░] 40% - 步骤 2/5:检查可用性"

目标: 验证视频存在且字幕可访问。

操作:

from youtube_transcript_api import YouTubeTranscriptApi, TranscriptsDisabled, NoTranscriptFound
import sys

video_id = sys.argv[1]

try:
    # 获取可用字幕列表
    transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
    
    print(f"✅ 视频可访问:{video_id}")
    print("📝 可用字幕:")
    
    for transcript in transcript_list:
        print(f"  - {transcript.language} ({transcript.language_code})")
        if transcript.is_generated:
            print("    [自动生成]")
    
except TranscriptsDisabled:
    print(f"❌ 视频 {video_id} 的字幕功能已禁用")
    sys.exit(1)
    
except NoTranscriptFound:
    print(f"❌ 未找到视频 {video_id} 的字幕")
    sys.exit(1)
    
except Exception as e:
    print(f"❌ 访问视频时出错:{e}")
    sys.exit(1)

错误处理:

错误消息操作
视频未找到"❌ 视频不存在或为私有"要求用户验证 URL
字幕已禁用"❌ 此视频的字幕功能已禁用"无法继续
无可用字幕"❌ 未找到字幕(未自动生成或手动添加)"无法继续
私有/受限视频"❌ 视频为私有或受限"要求提供公开视频

步骤 3:提取字幕

进度:

echo "[████████████░░░░░░░░] 60% - 步骤 3/5:提取字幕"

目标: 以首选语言检索字幕。

操作:

from youtube_transcript_api import YouTubeTranscriptApi

video_id = "VIDEO_ID"

try:
    # 首先尝试获取用户首选语言的字幕
    # 如果不可用,则回退到英语
    transcript = YouTubeTranscriptApi.get_transcript(
        video_id, 
        languages=['pt', 'en']  # 优先使用葡萄牙语,回退到英语
    )
    
    # 将字幕片段合并为完整文本
    full_text = " ".join([entry['text'] for entry in transcript])
    
    # 获取视频元数据
    from youtube_transcript_api import YouTubeTranscriptApi
    transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
    
    print("✅ 字幕提取成功")
    print(f"📊 字幕长度:{len(full_text)} 个字符")
    
    # 保存到临时文件以供处理
    with open(f"/tmp/transcript_{video_id}.txt", "w") as f:
        f.write(full_text)
    
except Exception as e:
    print(f"❌ 提取字幕时出错:{e}")
    exit(1)

字幕处理:

  • 将所有字幕片段合并为连贯的文本
  • 尽可能保留标点符号和格式
  • 删除重复或重叠的片段(如果是自动生成的伪影)
  • 存储到临时文件以供分析

步骤 4:生成全面摘要

进度:

echo "[████████████████░░░░] 80% - 步骤 4/5:生成摘要"

目标: 应用增强的 STAR + R-I-S-E 提示生成详细摘要。

应用的提示:

使用阶段 2 中的增强提示(STAR + R-I-S-E 框架),并将提取的字幕作为输入。

操作:

  1. 加载完整的字幕文本
  2. 应用全面的摘要提示
  3. 使用 AI 模型(Claude/GPT)生成结构化摘要
  4. 确保输出遵循定义的结构:
    • 带有视频元数据的标题
    • 执行摘要
    • 详细的逐节分解
    • 关键见解和结论
    • 概念和术语
    • 资源和引用

实现:

# 使用字幕文件作为 AI 提示的输入
TRANSCRIPT_FILE="/tmp/transcript_${VIDEO_ID}.txt"

# AI 代理将:
# 1. 读取字幕
# 2. 应用 STAR + R-I-S-E 摘要框架
# 3. 生成全面的 Markdown 输出
# 4. 使用标题、列表和高亮进行结构化

读取 "$TRANSCRIPT_FILE"  # 将字幕读入上下文

然后应用完整的摘要提示(来自阶段 2 的增强版本)。

步骤 5:格式化并呈现输出

进度:

echo "[████████████████████] 100% - 步骤 5/5:格式化输出"

目标: 以清晰、结构良好的 Markdown 格式提供摘要。

输出结构:

# [视频标题]

**频道:** [频道名称]  
**时长:** [时长]  
**URL:** [https://youtube.com/watch?v=VIDEO_ID]  
**发布日期:** [如果可用]

---

## 📝 详细摘要

### [主题 1]

[包含示例、数据、引用的全面解释...]

#### [子主题 1.1]

[详细分解...]

### [主题 2]

[继续详细分析...]

---

## 📚 概念和术语

- **[术语 1]:** [定义和上下文]
- **[术语 2]:** [定义和上下文]

---

## 📌 结论

[最终总结和要点]

示例 2:缺少依赖项

用户输入:

claude> 总结这个 YouTube 视频 https://youtu.be/abc123

技能响应:

⚠️  未安装 youtube-transcript-api

此技能需要 Python 库 'youtube-transcript-api'。

是否现在安装?
- [ ] 是 - 使用 pip 安装
- [ ] 否 - 我将手动安装

用户选择“是”:

$ pip install youtube-transcript-api
Successfully installed youtube-transcript-api-0.6.1

✅ 安装完成!继续处理视频摘要...

示例 4:无效 URL

用户输入:

claude> 总结 YouTube 视频 www.youtube.com/some-video

技能响应:

❌ 无效的 YouTube URL 格式

预期的格式示例:
- https://www.youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID

请提供有效的 YouTube 视频 URL。

📊 执行摘要

本视频全面介绍了人工智能(AI)的基本概念,专为希望了解现代 AI 的技术基础和实践应用的初学者和专业人士设计。讲师涵盖了从基本定义到机器学习算法的所有内容,使用实际示例和可视化来促进理解。

[……继续详细摘要……]


保存选项:

您想保存什么?
→ 摘要 + 原始字幕

✅ 文件已保存:resumo-exemplo123-2026-02-01.md(包含原始字幕)
[████████████████████] 100% - ✓ 处理完成!

欢迎观看这个关于机器学习基础的全面教程。在今天的视频中,我们将探索为现代 AI 系统提供动力的核心概念……


版本: 1.2.0 最后更新: 2026-02-02 维护者: Eric Andrade

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相关技能