Communitygithub.com

YouTube 影片摘要工具

從 YouTube 影片中提取字幕,並使用智慧分析框架生成詳盡的摘要。

YouTube 影片摘要工具 是什麼?

此技能旨在自動化 YouTube 影片內容分析流程。它從使用者提供的 YouTube URL 開始,驗證影片可用性,並使用 `youtube-transcript-api` Python 函式庫提取字幕。然後,它應用增強的 STAR + R-I-S-E 框架來產生全面的結構化摘要,捕捉所有見解、論點和關鍵要點。這對於需要深入內容分析而不需要重新觀看整部影片的開發者、研究人員或學生尤其有用。此技能支援 Claude Code、Cursor 和 Codex 等平台。工作流程包含清晰的進度指示器和錯誤處理,例如處理無效 URL、停用字幕的影片或缺少相依套件的情況。輸出格式為結構化的 Markdown,包含影片元數據、詳細摘要、概念和術語,以及結論,確保輸出的完整性和可讀性。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/AlperTuncOrtak/crypto-data-pipeline/tree/HEAD/skills/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 提示來建立詳細摘要。

套用的提示:

使用第二階段的增強提示(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"  # 將字幕讀取到上下文中

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

步驟 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 安裝
- [ ] 否 - 我會手動安裝

使用者選擇「是」:

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

AlperTuncOrtak/crypto-data-pipeline

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

AlperTuncOrtak/crypto-data-pipeline

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

AlperTuncOrtak/crypto-data-pipeline

One sentence - what this skill does and when to invoke it

AlperTuncOrtak/crypto-data-pipeline

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

AlperTuncOrtak/crypto-data-pipeline

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

AlperTuncOrtak/crypto-data-pipeline

Pull a YouTube video transcript into a queryable markdown vault with yt-dlp subtitle discovery, VTT cleanup, metadata frontmatter, and capture-seed stubs.

AlperTuncOrtak/crypto-data-pipeline

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

AlperTuncOrtak/crypto-data-pipeline

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

AlperTuncOrtak/crypto-data-pipeline

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

AlperTuncOrtak/crypto-data-pipeline

CRITICAL: Use for Makepad animation system. Triggers on: makepad animation, makepad animator, makepad hover, makepad state, makepad transition, "from: { all: Forward", makepad pressed, makepad 动画, makepad 状态, makepad 过渡, makepad 悬停效果

AlperTuncOrtak/crypto-data-pipeline

Best practices for Remotion - Video creation in React

AlperTuncOrtak/crypto-data-pipeline

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

AlperTuncOrtak/crypto-data-pipeline

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

AlperTuncOrtak/crypto-data-pipeline

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

AlperTuncOrtak/crypto-data-pipeline

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

AlperTuncOrtak/crypto-data-pipeline

Automate TikTok tasks via Rube MCP (Composio): upload/publish videos, post photos, manage content, and view user profiles/stats. Always search tools first for current schemas.

AlperTuncOrtak/crypto-data-pipeline

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

AlperTuncOrtak/crypto-data-pipeline

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

AlperTuncOrtak/crypto-data-pipeline

One sentence - what this skill does and when to invoke it

AlperTuncOrtak/crypto-data-pipeline

Automate YouTube tasks via Rube MCP (Composio): upload videos, manage playlists, search content, get analytics, and handle comments. Always search tools first for current schemas.

相關技能