mmk-youtube-channel-summary
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRecipe: YouTube Channel Summary to Notion
方案:YouTube频道摘要同步至Notion
Prerequisite: Readfor auth, global flags, and error handling. Uses:../mmk-shared/SKILL.md— Filter out Shorts. Uses:mmk-youtube-videotype— Video metadata (views, likes, etc.). Uses:mmk-youtube-metadata— Video transcript for summarization. Uses:mmk-youtube-transcript— Schema discovery and upsert commands.mmk-notion-database
A fully automatic workflow that fetches recent videos from one or more YouTube channel RSS feeds, filters out Shorts, collects metadata and transcripts, generates AI summaries, and upserts everything into a Notion database.
This recipe has side effects (creates/updates records in a Notion database). It requires manual invocation only.
No confirmation prompts — the recipe runs end-to-end automatically once invoked with the required parameters.
前置要求: 阅读了解认证、全局标志和错误处理相关内容。 依赖:../mmk-shared/SKILL.md— 过滤Shorts。 依赖:mmk-youtube-videotype— 获取视频元数据(播放量、点赞数等)。 依赖:mmk-youtube-metadata— 获取视频字幕文本用于生成摘要。 依赖:mmk-youtube-transcript— 数据库结构识别和更新插入(upsert)命令。mmk-notion-database
这是一个全自动工作流,可从一个或多个YouTube频道的RSS源获取最新视频,过滤掉Shorts,收集元数据和字幕文本,生成AI摘要,并将所有数据更新插入(upsert)至Notion数据库。
本方案会产生副作用(在Notion数据库中创建/更新记录),仅支持手动触发。
无确认提示 — 一旦传入所需参数触发,方案将自动从头执行到尾。
Database Schema Requirements
数据库结构要求
The recipe discovers properties by their Notion type and semantic meaning, not by exact name. English and Korean property names are both supported automatically.
本方案通过Notion属性类型和语义含义识别属性,而非精确名称。自动支持英文和韩文属性名称。
Required Properties
必填属性
| Purpose | Notion Type | Maps to | Auto-match names |
|---|---|---|---|
| VideoID | title | Upsert lookup key | (title property — always unambiguous) |
| Title | rich_text | Video title | Title, 제목, 영상제목 |
| Channel | rich_text | Channel name | Channel, 채널, 채널명 |
| URL | url | Video URL | URL, 링크, 영상링크 |
| Published | date | Publish date | Published, 발행일, 게시일, 업로드일 |
| 用途 | Notion类型 | 映射至 | 自动匹配名称 |
|---|---|---|---|
| 视频ID | title | 更新插入查找键 | (标题属性——始终明确) |
| 标题 | rich_text | 视频标题 | Title, 제목, 영상제목 |
| 频道 | rich_text | 频道名称 | Channel, 채널, 채널명 |
| 链接 | url | 视频链接 | URL, 링크, 영상링크 |
| 发布时间 | date | 发布日期 | Published, 발행일, 게시일, 업로드일 |
Optional Properties (auto-detected for enrichment)
可选属性(自动检测用于丰富数据)
| Purpose | Notion Type | Auto-match names |
|---|---|---|
| Thumbnail | url | Thumbnail, 썸네일 |
| Summary | rich_text | Summary, 요약, AI요약 |
| Topics | multi_select or rich_text | Topics, 주제, 태그, Tags |
| ViewCount | number | Views, 조회수 |
| LikeCount | number | Likes, 좋아요, 좋아요수 |
| 用途 | Notion类型 | 自动匹配名称 |
|---|---|---|
| 缩略图 | url | Thumbnail, 썸네일 |
| 摘要 | rich_text | Summary, 요약, AI요약 |
| 主题 | multi_select 或 rich_text | Topics, 주제, 태그, Tags |
| 播放量 | number | Views, 조회수 |
| 点赞数 | number | Likes, 좋아요, 좋아요수 |
Notes
注意事项
- Title property as VideoID: The title property stores the video ID (e.g., ) and serves as the upsert lookup key. This prevents duplicates on re-runs. The human-readable video title goes into a separate rich_text property.
dQw4w9WgXcQ - Type-first matching: The title type is unique per database (always unambiguous). For url, number, and rich_text types, name patterns resolve ambiguity.
- Ambiguity handling: If multiple properties match a required purpose, present options and ask the user to choose.
- Summary property: If no Summary property is found, AI summaries will be displayed in the final report but not written to Notion.
- 标题属性作为视频ID: 标题属性存储视频ID(例如 ),并作为更新插入的查找键,避免重复执行时产生重复数据。易读的视频标题存储在单独的rich_text属性中。
dQw4w9WgXcQ - 优先按类型匹配: 每个数据库的title类型属性是唯一的(始终明确)。对于url、number和rich_text类型,通过名称模式解决歧义。
- 歧义处理: 如果多个属性匹配某个必填用途,将列出选项并请求用户选择。
- 摘要属性: 如果未找到摘要属性,AI摘要将显示在最终报告中,但不会写入Notion。
Workflow
工作流
This workflow runs fully automatically. For multiple channel IDs, Steps 1-6 repeat per channel. Steps 7-9 run once after all channels are processed.
本工作流全程自动执行。若传入多个频道ID,步骤1-6将针对每个频道重复执行。步骤7-9在所有频道处理完成后执行一次。
Step 1: Fetch RSS feed
步骤1:获取RSS源
bash
curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=CHANNEL_ID"Parse the XML response to extract elements. From each entry, collect:
<entry>- — video ID
<yt:videoId> - — video title
<title> - — publish date (ISO 8601)
<published> - — video URL
<link href="..."/> - — thumbnail URL
<media:group><media:thumbnail url="..." /></media:group>
If the feed returns empty or an error, log the failure and skip to the next channel.
bash
curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=CHANNEL_ID"解析XML响应以提取元素。从每个元素中收集:
<entry>- — 视频ID
<yt:videoId> - — 视频标题
<title> - — 发布日期(ISO 8601格式)
<published> - — 视频链接
<link href="..."/> - — 缩略图链接
<media:group><media:thumbnail url="..." /></media:group>
若源返回空或出现错误,记录失败信息并跳过至下一个频道。
Step 2: Filter by date
步骤2:按日期过滤
Filter entries to only those published within the last N days (default: 7).
If no entries remain, log "No videos published in the last N days for channel [ID]" and skip to the next channel.
过滤出最近N天内发布的视频(默认:7天)。
若过滤后无剩余视频,记录“频道[ID]最近N天内无发布视频”并跳过至下一个频道。
Step 3: Filter out Shorts
步骤3:过滤Shorts
For each remaining video, check the video type:
bash
mmk youtube videotype <video_id> -o jsonKeep only entries where is . Discard entries where is .
type"video"type"short"If no videos remain, log "All recent videos are Shorts for channel [ID]" and skip to the next channel.
对每个剩余视频,检查视频类型:
bash
mmk youtube videotype <video_id> -o json仅保留为的条目,丢弃为的条目。
type"video"type"short"若过滤后无剩余视频,记录“频道[ID]最近的视频均为Shorts”并跳过至下一个频道。
Step 4: Get metadata
步骤4:获取元数据
bash
mmk youtube metadata <video_id> -o jsonCollect from each response: title (authoritative), author/channel name, viewCount, likeCount, publishDate.
If metadata fails for a video, use the RSS title and channel name as fallback.
bash
mmk youtube metadata <video_id> -o json从每个响应中收集:权威标题、作者/频道名称、播放量、点赞数、发布日期。
若某视频的元数据获取失败,使用RSS中的标题和频道名称作为备选。
Step 5: Get transcripts
步骤5:获取字幕文本
bash
mmk youtube transcript <video_id> -o jsonCollect the field. If a video has no captions, mark as "No transcript available" and continue.
contentbash
mmk youtube transcript <video_id> -o json收集字段。若某视频无字幕,标记为“无可用字幕文本”并继续执行。
contentStep 6: AI-summarize
步骤6:生成AI摘要
For each video:
- If transcript available: generate a concise summary (2-4 sentences) covering the main topic and key points, plus 3-5 topic tags
- If no transcript: generate a brief description from the title and metadata only, noting "(from metadata only)"
对每个视频:
- 若有字幕文本:生成简洁摘要(2-4句话),涵盖主要主题和关键点,同时生成3-5个主题标签
- 若无字幕文本:仅通过标题和元数据生成简短描述,并标注“(仅基于元数据)”
Step 7: Discover Notion database schema
步骤7:识别Notion数据库结构
bash
mmk notion database schema --database-id <db-uuid> --enhanced -o jsonbash
mmk notion database schema --database-id <db-uuid> --enhanced -o json7a. Required property discovery
7a. 必填属性识别
Map database properties to required purposes using type-first, then name-pattern matching:
- VideoID: Use the single type property (always unambiguous).
title - Title: Find matching:
rich_text,Title,제목.영상제목 - Channel: Find matching:
rich_text,Channel,채널.채널명 - URL: Find type properties. If exactly one, use it. If multiple, match by name:
url,URL,링크.영상링크 - Published: Find type properties. If exactly one, use it. If multiple, match by name:
date,Published,발행일,게시일.업로드일
If any required purpose has zero candidates, stop with a clear error listing what is missing and what types/names are expected.
通过优先按类型,再按名称模式的方式,将数据库属性映射至必填用途:
- 视频ID: 使用唯一的类型属性(始终明确)。
title - 标题: 查找匹配、
Title、제목的영상제목属性。rich_text - 频道: 查找匹配、
Channel、채널的채널명属性。rich_text - 链接: 查找url类型属性。若仅有一个,直接使用;若有多个,通过名称匹配、
URL、링크。영상링크 - 发布时间: 查找date类型属性。若仅有一个,直接使用;若有多个,通过名称匹配、
Published、발행일、게시일。업로드일
若某必填用途无匹配属性,终止执行并清晰列出缺失的用途及预期的类型/名称。
7b. Optional property discovery
7b. 可选属性识别
Scan remaining properties for enrichment fields:
- Thumbnail: type matching
url,Thumbnail썸네일 - Summary: type matching
rich_text,Summary,요약AI요약 - Topics: or
multi_selecttype matchingrich_text,Topics,주제,태그Tags - ViewCount: type matching
number,Views조회수 - LikeCount: type matching
number,Likes,좋아요좋아요수
Report discovered mappings and continue automatically.
扫描剩余属性以识别可丰富数据的字段:
- 缩略图: 匹配、
Thumbnail的url类型属性썸네일 - 摘要: 匹配、
Summary、요약的rich_text类型属性AI요약 - 主题: 匹配、
Topics、주제、태그的multi_select或rich_text类型属性Tags - 播放量: 匹配、
Views的number类型属性조회수 - 点赞数: 匹配、
Likes、좋아요的number类型属性좋아요수
报告识别到的映射关系并自动继续执行。
Step 8: Upsert to Notion
步骤8:更新插入至Notion
Build the upsert data array using the discovered property names. Replace property keys with actual Notion property names from Step 7.
bash
mmk notion database upsert --database-id <db-uuid> --lookup <title-property-name> --data '[
{"<VideoID>":"abc123","<Title>":"How to Cook Pasta","<Channel>":"ChefChan","<URL>":"https://www.youtube.com/watch?v=abc123","<Published>":"2026-03-20","<Thumbnail>":"https://i.ytimg.com/vi/abc123/hqdefault.jpg","<Summary>":"A guide to making fresh pasta...","<ViewCount>":12345,"<LikeCount>":890},
{"<VideoID>":"def456","<Title>":"Kitchen Tips","<Channel>":"ChefChan","<URL>":"https://www.youtube.com/watch?v=def456","<Published>":"2026-03-18","<Summary>":"Tips for organizing...","<ViewCount>":8901,"<LikeCount>":456}
]' -o jsonOnly include optional properties that were successfully discovered in Step 7b. For Topics with type, pass as an array (e.g., ). For type, pass as a comma-separated string.
multi_select["cooking","pasta"]rich_text使用步骤7中识别到的属性名称构建更新插入数据数组。将属性键替换为步骤7中实际的Notion属性名称。
bash
mmk notion database upsert --database-id <db-uuid> --lookup <title-property-name> --data '[
{"<VideoID>":"abc123","<Title>":"How to Cook Pasta","<Channel>":"ChefChan","<URL>":"https://www.youtube.com/watch?v=abc123","<Published>":"2026-03-20","<Thumbnail>":"https://i.ytimg.com/vi/abc123/hqdefault.jpg","<Summary>":"A guide to making fresh pasta...","<ViewCount>":12345,"<LikeCount>":890},
{"<VideoID>":"def456","<Title>":"Kitchen Tips","<Channel>":"ChefChan","<URL>":"https://www.youtube.com/watch?v=def456","<Published>":"2026-03-18","<Summary>":"Tips for organizing...","<ViewCount>":8901,"<LikeCount>":456}
]' -o json仅包含步骤7b中成功识别的可选属性。若主题属性为multi_select类型,以数组形式传入(例如 );若为rich_text类型,以逗号分隔的字符串形式传入。
["cooking","pasta"]Step 9: Present final summary
步骤9:展示最终摘要
Display a single table with all results across all channels:
undefined显示包含所有频道结果的汇总表格:
undefinedYouTube Channel Summary Complete
YouTube频道摘要同步完成
- Channels processed: 3
- Period: Last 7 days
- Videos found: 15 | Shorts filtered: 4 | Regular videos: 11
- Transcripts: 9 available, 2 unavailable
- Upserted to Notion: 11 records (8 new, 3 updated)
| # | Channel | Title | Published | Views | Likes | Topics | Summary |
|---|---|---|---|---|---|---|---|
| 1 | ChefChan | How to Cook Pasta | 2026-03-20 | 12,345 | 890 | cooking, pasta | A guide to making fresh... |
| 2 | ChefChan | Kitchen Tips | 2026-03-18 | 8,901 | 456 | kitchen, tips | Tips for organizing... |
| 3 | DevTube | Building CLI Tools | 2026-03-19 | 5,432 | 321 | CLI, Node.js | Demonstrates building... |
undefined- 处理的频道数:3
- 时间范围:最近7天
- 找到的视频数:15 | 过滤的Shorts:4 | 常规视频:11
- 字幕文本:9个可用,2个不可用
- 同步至Notion的记录:11条(8条新增,3条更新)
| # | 频道 | 标题 | 发布时间 | 播放量 | 点赞数 | 主题 | 摘要 |
|---|---|---|---|---|---|---|---|
| 1 | ChefChan | 如何制作意面 | 2026-03-20 | 12,345 | 890 | cooking, pasta | 一份制作新鲜意面的指南... |
| 2 | ChefChan | 厨房实用技巧 | 2026-03-18 | 8,901 | 456 | kitchen, tips | 厨房整理实用技巧... |
| 3 | DevTube | 构建CLI工具 | 2026-03-19 | 5,432 | 321 | CLI, Node.js | 演示如何构建... |
undefinedParameters
参数
| Parameter | Required | Description |
|---|---|---|
| Yes | One or more YouTube channel IDs (comma-separated or listed individually) |
| Yes | Notion database ID or URL |
| No | Number of days to look back (default: 7) |
| 参数 | 是否必填 | 说明 |
|---|---|---|
| 是 | 一个或多个YouTube频道ID(逗号分隔或单独列出) |
| 是 | Notion数据库ID或链接 |
| 否 | 回溯的天数(默认:7) |
Error Handling
错误处理
| Scenario | Action |
|---|---|
| Auth failure on any mmk command | Stop workflow, report |
| Invalid channel ID or empty RSS feed | Log warning, skip to next channel |
| RSS fetch failure (curl error) | Log warning, skip to next channel |
| No videos in date range for a channel | Log, skip to next channel |
| All videos are Shorts for a channel | Log, skip to next channel |
| All channels yield zero videos | Report "No regular videos found across all channels" and stop |
| videotype command fails for a video | Skip that video, log warning, continue |
| metadata command fails for a video | Use RSS title/channel as fallback, continue |
| Transcript unavailable | Summarize from metadata only, continue |
| Database not found | Stop, report error with database-id |
| Required property not discovered | Stop, list missing purpose and expected types/names |
| Property discovery ambiguous | Present candidates, ask user to choose |
| Upsert partial failure | Log failed records, report partial results |
| No Summary property in database | Display summaries in output but skip writing them |
| 场景 | 处理方式 |
|---|---|
| 任何mmk命令认证失败 | 终止工作流,提示需要执行 |
| 无效频道ID或RSS源为空 | 记录警告,跳过至下一个频道 |
| RSS源获取失败(curl错误) | 记录警告,跳过至下一个频道 |
| 某频道在指定时间范围内无视频 | 记录信息,跳过至下一个频道 |
| 某频道的所有视频均为Shorts | 记录信息,跳过至下一个频道 |
| 所有频道均无符合要求的视频 | 报告“所有频道均未找到常规视频”并终止 |
| 某视频的videotype命令执行失败 | 跳过该视频,记录警告,继续执行 |
| 某视频的metadata命令执行失败 | 使用RSS中的标题/频道作为备选,继续执行 |
| 字幕文本不可用 | 仅基于元数据生成摘要,继续执行 |
| 未找到数据库 | 终止执行,报告database-id错误 |
| 未识别到必填属性 | 终止执行,列出缺失的用途及预期的类型/名称 |
| 属性识别存在歧义 | 列出候选属性,请求用户选择 |
| 更新插入部分失败 | 记录失败的记录,报告部分结果 |
| 数据库中无摘要属性 | 在输出中显示摘要,但不写入Notion |
Example Session
示例会话
User: /mmk-youtube-channel-summary
Channels: UC_x5XG1OV2P6uZZ5FSM9Ttw, UCddiUEpeqJcYeBxX1IVBKvQ
Database: abc123-def456
Last 7 days
Claude: [Channel 1/2] UC_x5XG1OV2P6uZZ5FSM9Ttw
[Step 1] Fetching RSS feed... 15 entries found.
[Step 2] Filtering to last 7 days... 10 videos.
[Step 3] Checking video types... 8 regular, 2 Shorts filtered.
[Step 4] Fetching metadata... 8/8 complete.
[Step 5] Fetching transcripts... 7/8 available, 1 no captions.
[Step 6] Generating summaries... 8/8 complete.
[Channel 2/2] UCddiUEpeqJcYeBxX1IVBKvQ
[Step 1] Fetching RSS feed... 12 entries found.
[Step 2] Filtering to last 7 days... 6 videos.
[Step 3] Checking video types... 5 regular, 1 Short filtered.
[Step 4] Fetching metadata... 5/5 complete.
[Step 5] Fetching transcripts... 5/5 available.
[Step 6] Generating summaries... 5/5 complete.
[Step 7] Discovering Notion database schema...
Property mapping (auto-detected):
VideoID -> "VideoID" (title)
Title -> "제목" (rich_text)
Channel -> "채널" (rich_text)
URL -> "URL" (url)
Published -> "게시일" (date)
Optional fields discovered:
Thumbnail -> "썸네일" (url)
Summary -> "AI요약" (rich_text)
Topics -> "태그" (multi_select)
ViewCount -> "조회수" (number)
LikeCount -> "좋아요" (number)
[Step 8] Upserting 13 videos to Notion...
Upserted: 13 records (11 new, 2 updated).
[Step 9] Complete!
- Channels processed: 2
- Period: Last 7 days
- Videos: 16 found, 3 Shorts filtered, 13 regular
- Transcripts: 12 available, 1 unavailable
- Upserted: 13 records (11 new, 2 updated)
| # | Channel | Title | Published | Views | Topics | Summary |
|---|------------|----------------------|------------|--------|-------------------|----------------------------|
| 1 | ChefChan | How to Cook Pasta | 2026-03-20 | 12,345 | cooking, pasta | A guide to making fresh... |
| 2 | ChefChan | Kitchen Organization | 2026-03-19 | 8,901 | kitchen, tips | Tips for organizing... |
| 3 | DevTube | Building CLI Tools | 2026-03-19 | 5,432 | CLI, Node.js | Demonstrates building... |
| ... |用户: /mmk-youtube-channel-summary
频道: UC_x5XG1OV2P6uZZ5FSM9Ttw, UCddiUEpeqJcYeBxX1IVBKvQ
数据库: abc123-def456
时间范围: 最近7天
Claude: [频道1/2] UC_x5XG1OV2P6uZZ5FSM9Ttw
[步骤1] 获取RSS源... 找到15条记录。
[步骤2] 过滤最近7天的视频... 10个视频。
[步骤3] 检查视频类型... 8个常规视频,4个Shorts被过滤。
[步骤4] 获取元数据... 8/8完成。
[步骤5] 获取字幕文本... 7/8可用,1个不可用。
[步骤6] 生成AI摘要... 8/8完成。
[频道2/2] UCddiUEpeqJcYeBxX1IVBKvQ
[步骤1] 获取RSS源... 找到12条记录。
[步骤2] 过滤最近7天的视频... 6个视频。
[步骤3] 检查视频类型... 5个常规视频,1个Short被过滤。
[步骤4] 获取元数据... 5/5完成。
[步骤5] 获取字幕文本... 5/5可用。
[步骤6] 生成AI摘要... 5/5完成。
[步骤7] 识别Notion数据库结构...
自动识别的属性映射:
视频ID -> "VideoID" (title)
标题 -> "제목" (rich_text)
频道 -> "채널" (rich_text)
链接 -> "URL" (url)
发布时间 -> "게시일" (date)
识别到的可选字段:
缩略图 -> "썸네일" (url)
摘要 -> "AI요약" (rich_text)
主题 -> "태그" (multi_select)
播放量 -> "조회수" (number)
点赞数 -> "좋아요" (number)
[步骤8] 将13个视频同步至Notion...
同步完成: 13条记录(11条新增,2条更新)。
[步骤9] 完成!
- 处理的频道数: 2
- 时间范围: 最近7天
- 视频统计: 16个找到,3个Shorts被过滤,13个常规视频
- 字幕文本: 12个可用,1个不可用
- 同步记录: 13条(11条新增,2条更新)
| # | 频道 | 标题 | 发布时间 | 播放量 | 主题 | 摘要 |
|---|------------|----------------------|------------|--------|-------------------|----------------------------|
| 1 | ChefChan | 如何制作意面 | 2026-03-20 | 12,345 | cooking, pasta | 一份制作新鲜意面的指南... |
| 2 | ChefChan | 厨房整理技巧 | 2026-03-18 | 8,901 | kitchen, tips | 厨房整理实用技巧... |
| 3 | DevTube | 构建CLI工具 | 2026-03-19 | 5,432 | CLI, Node.js | 演示如何构建CLI工具... |
| ... |See Also
相关链接
- mmk-shared — Auth, global flags, error handling
- mmk-youtube — All YouTube commands overview
- mmk-youtube-videotype — Video vs Short detection
- mmk-youtube-metadata — Video metadata
- mmk-youtube-transcript — Video transcript
- mmk-notion-database — Schema, query, upsert commands
- mmk-shared — 认证、全局标志、错误处理
- mmk-youtube — 所有YouTube命令概览
- mmk-youtube-videotype — 区分常规视频与Shorts
- mmk-youtube-metadata — 视频元数据获取
- mmk-youtube-transcript — 视频字幕文本获取
- mmk-notion-database — 数据库结构识别、查询、更新插入命令