Communitygithub.com

ASoudy/AGS

將 YouTube 影片字幕擷取到 Markdown 筆記庫中,成為可查詢的條目,並搭配 yt-dlp 字幕探索、VTT 清理、元數據前置資料與觸發關鍵字草稿。

AGS 是什麼?

此技能能將 YouTube 影片的字幕檔案(手動或自動產生的)擷取至 Markdown 筆記庫,生成包含完整元數據前置資料(如標題、頻道、上傳日期、時長等)與清理後字幕文字的結構化條目。它依賴 yt-dlp 來探索並下載字幕,自動處理 VTT 時間戳記並合併為段落,同時保留說話者標籤。技能會掃描字幕中的關鍵字(如「決策」、「框架」、「模型」等),自動建立寫作草稿 stub 檔案,方便後續的知識圖譜萃取、內容再利用等下游任務使用。支援單一 YouTube 影片網址,預設語言為英文與西班牙文,並可透過命令列參數指定筆記庫路徑與語言代碼。若無可用字幕,則會建立包含影片元數據的 stub 檔案而非直接失敗,確保流程不中斷。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ASoudy/AGS/tree/HEAD/AGAS/plugins/antigravity-awesome-skills-claude/skills/ingest-youtube

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

ingest-youtube — YouTube 到筆記庫連接器

將 YouTube 影片字幕拉入 Markdown 筆記庫,成為可查詢的類型化記憶條目,供下游技能(知識圖譜萃取、語音指紋訓練、內容再利用、行動項目萃取)操作。

模式與 ingest-slack、ingest-whatsapp、ingest-notion、ingest-linear、ingest-github、ingest-gmail 相同。加入 YouTube 只需新增一個正規化器,而非新架構。

使用時機

  • 使用者貼上 YouTube 網址並要求取得字幕或摘要
  • 使用者輸入 /ingest-youtube <url> 處理單一影片
  • 使用者要求將講座/播客/主題演講存入筆記庫(capture、sync、ingest、transcribe、pull)

請勿用於:

  • 下載實際影片檔案(請直接使用 yt-dlp 搭配 -f best)
  • 頻道層級擷取或 --days 時間範圍;此腳本一次只處理一個影片網址
  • 直播(字幕不穩定)
  • 非 YouTube 來源(Vimeo、Twitch、Twitter Spaces 各有專用連接器)
  • 一次性閱讀字幕但無需建立筆記庫檔案(直接執行 yt-dlp --write-auto-sub 並輸出到 stdout)

運作原理

  1. 將輸入解析為一個 YouTube 影片網址。
  2. 確認 yt-dlp 已安裝。若未安裝,腳本會顯示安裝說明:brew install yt-dlp(macOS)或 pip3 install --user yt-dlp。
  3. 呼叫 yt-dlp --list-subs <url> 列舉可用字幕。
  4. 字幕優先順序:手動字幕 > 自動產生的字幕。手動字幕保留創作者提供的標點符號與說話者標籤;自動字幕則為全大寫且無標點。
  5. 透過 yt-dlp --write-sub --sub-lang <lang> --skip-download 下載最高優先順序的 VTT 字幕。預設語言偏好:en,es(英文優先,西班牙文其次)。
  6. 移除 VTT 時間標記,合併為乾淨的散文段落。移除重複行(自動產生的 VTT 通常會有行重複)。若來源有說話者標籤則保留。
  7. 透過 yt-dlp --print-json --skip-download 取得影片元數據(標題、頻道、上傳日期、時長、video_id、網址)。
  8. 將頻道名稱與影片標題轉為 slug 格式。寫入 External Inputs/YouTube/<channel-slug>/<YYYY-MM-DD>-<video-slug>.md。
  9. 掃描字幕中的觸發關鍵字(decision、framework、model、principle、「the lesson is」、playbook、anti-pattern、case study)。每個匹配結果會建立一個寫作草稿 stub,存放於 Meta/Captures/<YYYY-MM-DD>-youtube-<channel-slug>-<video-id>.md,讓草稿進入擷取彙總器。
  10. 輸出摘要:檔案路徑、字幕字數、語言、偵測到的草稿數量。

呼叫方式

python3 ingest.py <youtube-url> [--vault <path>] [--lang <code>]

預設值:

  • --vault:$VAULT_ROOT 環境變數或目前目錄
  • --lang:en,es(英文優先,西班牙文其次;符合常見的雙語預設)
  • --whisper:接受此旗標作為未來備援方案,但此版本在無可用字幕時只會寫入一個 stub

輸出合約

位於 External Inputs/YouTube/<channel-slug>/<YYYY-MM-DD>-<video-slug>.md 的筆記庫檔案包含前置資料:

---
type: external-input
source: youtube
video_id: <11 字元 ID>
url: https://www.youtube.com/watch?v=<id>
channel: <頻道名稱>
channel_url: https://www.youtube.com/<handle>
title: <影片標題>
upload_date: <YYYY-MM-DD>
duration_seconds: <整數>
language: <ISO 代碼>
subtitle_source: manual | auto | whisper
word_count: <整數>
ingested_at: <ISO 8601 時間戳>
---

正文為清理後的段落散文。若來源有說話者標籤,則每段對話格式為 **<說話者>:** <文字>。

冪等性

重新擷取同一個影片網址會覆蓋同一個筆記庫檔案。草稿 stub 的檔名會包含 video_id 的雜湊值,因此同一來源影片在不同執行中會產生相同的 stub 檔名。重新執行只會刷新,不會重複。

無字幕時的處理

若 yt-dlp --list-subs 未傳回任何手動或自動字幕,腳本會寫入一個包含影片元數據與來源網址的 stub 筆記庫檔案,而非直接失敗。--whisper 旗標保留給未來本機語音辨識備援方案,目前會報告該備援尚未實作。

今日的手動備援方案:使用 yt-dlp 下載音訊,透過你本機的 Whisper 流程進行轉錄,然後在重新執行擷取前加入字幕或轉錄文字。

限制

  • 每次執行只處理一個 YouTube 影片網址;頻道句柄、播放清單與 --days 時間範圍不在範圍內。
  • 依賴 yt-dlp 回傳的字幕;無字幕的影片只會產生元數據 stub,不會有轉錄內容。
  • 此版本不下載影片檔案,也不執行內建的 Whisper 轉錄。
  • 網路可用性、YouTube 字幕存取權限與本機 yt-dlp 行為決定擷取是否成功。

驗收測試

對 YouTube 上傳的第一部影片執行:

python3 ingest.py "https://www.youtube.com/watch?v=jNQXAC9IVRw" --vault /tmp/test

預期輸出:

Wrote 39 words to /tmp/test/External Inputs/YouTube/jawed/2005-04-24-me-at-the-zoo.md. Language: en. Subtitle source: manual.

輸出檔案包含有效的前置資料與乾淨的散文正文。

相依性

  • yt-dlp(必要):透過 brew install yt-dlp 或 pip3 install --user yt-dlp 安裝
  • whisper-cpp(選用,用於此腳本外的手動備援方案)

來源

收錄於 adelaidasofia/ai-brain-starter,一個針對 AI 代理的驗證框架,確保記憶會累積而非混亂。此技能屬於 ingest-* 系列筆記庫連接器的一部分。

Individual skills in this repo

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

ASoudy/AGS

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

ASoudy/AGS

Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

ASoudy/AGS

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

ASoudy/AGS

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

ASoudy/AGS

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.

ASoudy/AGS

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

ASoudy/AGS

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.

ASoudy/AGS

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.

ASoudy/AGS

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

ASoudy/AGS

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 悬停效果

ASoudy/AGS

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

ASoudy/AGS

Next.js App Router principles. Server Components, data fetching, routing patterns.

ASoudy/AGS

Expert integration of Supabase Auth with Next.js App Router

ASoudy/AGS

React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

ASoudy/AGS

Best practices for Remotion - Video creation in React

ASoudy/AGS

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

ASoudy/AGS

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

ASoudy/AGS

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.

ASoudy/AGS

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

ASoudy/AGS

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

相關技能