Communitygithub.com

YouTube 摘要產生器

從 YouTube 影片中提取逐字稿,並使用智慧分析框架生成全面且詳細的摘要。

YouTube 摘要產生器 是什麼?

這是一個針對 AI 代理(如 Claude Code、Cursor、Codex)設計的技能,能夠從 YouTube 影片中提取逐字稿,並應用增強的 STAR + R-I-S-E 框架,生成結構化的詳細摘要。主要功能包括:驗證影片 URL、檢查影片與逐字稿可用性、提取逐字稿(支援多語言,優先葡萄牙語,後備英語)、產生包含標題、頻道、時長、章節重點、關鍵概念和結論的完整文檔。此技能特別適合需要深入分析教育影片、講座、教學或資訊內容的使用者,能大幅節省重看影片的時間,並獲得可供參考的完整記錄。支援所有主流 YouTube URL 格式,並內建依賴檢查與安裝引導。

相容平台✓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 摘要產生器 是做什麼的?

目的

此技能從 YouTube 影片中提取逐字稿,並使用增強的 STAR + R-I-S-E 框架生成全面且詳細的摘要。它會驗證影片可用性、使用 youtube-transcript-api Python 函式庫提取逐字稿,並產出捕捉所有見解、論點和重點的詳細文件。

此技能專為需要從教育影片、講座、教學或資訊內容中進行深入內容分析和製作參考文件的用戶而設計。

何時使用此技能

應在以下情況使用此技能:

  • 使用者提供 YouTube 影片網址並想要詳細摘要
  • 使用者需要記錄影片內容以供參考,無需重新觀看
  • 使用者想要從教育內容中提取見解、重點和論點
  • 使用者需要 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:驗證網址"

格式規範:

  • 寬度 20 個字元(使用 █ 表示已完成,░ 表示未完成)
  • 百分比增量:步驟 1 = 20%,步驟 2 = 40%,步驟 3 = 60%,步驟 4 = 80%,步驟 5 = 100%
  • 步驟計數器顯示當前/總數(例如「步驟 3/5」)
  • 當前階段的簡短說明

在步驟 1 之前顯示初始狀態框:

╔══════════════════════════════════════════════════════════════╗
║     📹  YouTube 摘要產生器 - 處理影片                        ║
╠══════════════════════════════════════════════════════════════╣
║ → 步驟 1:驗證網址                    [進行中]                ║
║ ○ 步驟 2:檢查可用性                                        ║
║ ○ 步驟 3:提取逐字稿                                        ║
║ ○ 步驟 4:生成摘要                                          ║
║ ○ 步驟 5:格式化輸出                                        ║
╠══════════════════════════════════════════════════════════════╣
║ 進度:██████░░░░░░░░░░░░░░░░░░░░░░░░  20%                   ║
╚══════════════════════════════════════════════════════════════╝

步驟 1:驗證 YouTube 網址

目標: 提取影片 ID 並驗證網址格式。

支援的網址格式:

  • 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

操作:

# 使用正則表達式或網址解析提取影片 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 網址格式"
    exit 1
fi

echo "📹 影片 ID 已提取:$VIDEO_ID"

如果網址無效:

❌ 無效的 YouTube 網址

請提供以下格式的有效 YouTube 網址:
- 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)

錯誤處理:

錯誤訊息操作
找不到影片"❌ 影片不存在或設為私人"要求使用者驗證網址
逐字稿停用"❌ 此影片的逐字稿功能已停用"無法繼續
無可用逐字稿"❌ 找不到逐字稿(未自動產生或手動新增)"無法繼續
私人/限制影片"❌ 影片為私人或受限制"要求提供公開影片

步驟 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. 使用標題、列表和重點標記進行結構化

Read "$TRANSCRIPT_FILE"  # 將逐字稿讀入上下文

然後套用完整的摘要生成提示(來自階段 2 的增強版本)。

步驟 5:格式化與呈現輸出

進度:

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

目標: 以乾淨、結構良好的 Markdown 提供摘要。

輸出結構:

# [影片標題]

**頻道:** [頻道名稱]  
**時長:** [時長]  
**網址:** [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 安裝
  • 否 - 我會手動安裝

**使用者選擇「是」:**

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

✅ 安裝完成!繼續處理影片摘要...

範例 4:無效網址

使用者輸入:

claude> 總結 youtube 影片 www.youtube.com/some-video

技能回應:

❌ 無效的 YouTube 網址格式

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

請提供有效的 YouTube 影片網址。

📊 執行摘要

這部影片全面介紹了人工智慧(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

相關技能