| name | youtube-collector |
| description | Skill for registering YouTube channels, collecting new content, and generating transcript-based summaries. Use when the user (1) requests YouTube channel registration/management, (2) requests collection of new videos from registered channels, or (3) requests YouTube video summaries. Data is stored in YAML format under the .reference/ folder. |
| context | fork |
YouTube Collector
Collects new content from registered YouTube channels and generates transcript-based summaries.
Prerequisites
Required packages:
pip install google-api-python-client youtube-transcript-api pyyaml
API key setup: For security, the API key is stored in the user's home directory.
python3 scripts/setup_api_key.py
python3 scripts/setup_api_key.py --api-key YOUR_API_KEY
python3 scripts/setup_api_key.py --show
Configuration file path:
- macOS/Linux:
~/.config/youtube-collector/config.yaml
- Windows:
%APPDATA%\youtube-collector\config.yaml
Workflow
1. Channel Registration
Register by channel URL or handle:
python3 scripts/register_channel.py --channel-handle @channelname --output-dir .reference/
python3 scripts/register_channel.py --channel-url "https://youtube.com/@channelname" --output-dir .reference/
Result: Channel information is added to .reference/channels.yaml.
2. Content Collection
The script automatically handles video listing + transcript collection + YAML file saving:
python3 scripts/collect_videos.py --channel-handle @channelname --output-dir .reference/ --max-results 10
python3 scripts/collect_videos.py --all --output-dir .reference/
Result: .reference/contents/{channel_handle}/{video_id}.yaml files are generated.
3. Summary Generation
After checking newly added videos from the collection result JSON, add a summary field to each video's YAML file:
summary:
source: "transcript"
content: |
## ์๋ก
- ๋ฌธ์ ์ ๊ธฐ ๋๋ ์ฃผ์ ์๊ฐ
- ์์์ ๋ชฉ์ /๋ฐฐ๊ฒฝ
- ํต์ฌ ๋ด์ฉ ์์ธ ์ค๋ช
- ํด๊ฒฐ์ฑ
, ๋ฐฉ๋ฒ๋ก , ์์ ๋ฑ
- ์ฃผ์ ํฌ์ธํธ๋ณ ์ ๋ฆฌ
- ํต์ฌ ์์ฝ
- ์์ฌ์ ๋๋ ๋ค์ ๋จ๊ณ
Summary generation criteria:
transcript.available: true -> Transcript-based summary, summary.source: "transcript"
transcript.available: false -> Description-based summary, summary.source: "description"
4. Data Retrieval
Checking collected content:
- Browse the
.reference/contents/ folder structure
- Read YAML files for specific channels/videos and provide the information
Script Options
register_channel.py
| Option | Description |
|---|
--channel-handle | Channel handle (@username) |
--channel-url | Channel URL |
--channel-id | Channel ID (UC...) |
--output-dir | Output directory (default: .reference) |
collect_videos.py
| Option | Description |
|---|
--channel-handle | Specific channel handle |
--channel-id | Specific channel ID |
--all | Process all channels in channels.yaml |
--output-dir | Output directory (default: .reference) |
--max-results | Maximum collection count per channel (default: 10) |
--language | Preferred transcript language (default: ko) |
--no-skip-existing | Overwrite existing files |
Data Structure
Detailed schema: references/data-schema.md
Video Data Example
video_id: "abc123"
title: "์์ ์ ๋ชฉ"
published_at: "2025-12-10T10:00:00Z"
url: "https://youtube.com/watch?v=abc123"
thumbnail: "https://..."
description: "์์ ์ค๋ช
..."
duration: "PT10M30S"
collected_at: "2025-12-13T15:00:00Z"
transcript:
available: true
language: "ko"
text: "์๋ง ์ ์ฒด..."
summary:
source: "transcript"
content: |
## ์๋ก
- ์์์ ๋ฐฐ๊ฒฝ ๋ฐ ๋ชฉ์
- ํต์ฌ ๋ด์ฉ 1
- ํต์ฌ ๋ด์ฉ 2
- ํต์ฌ ์์ฝ
Error Handling
| Situation | User-Facing Message |
|---|
| API key not configured | "YouTube Data API ํค๊ฐ ํ์ํฉ๋๋ค. python3 scripts/setup_api_key.py๋ก ์ค์ ํด์ฃผ์ธ์." |
| No channels registered | "๋ฑ๋ก๋ ์ฑ๋์ด ์์ต๋๋ค. ๋จผ์ ์ฑ๋์ ๋ฑ๋กํด์ฃผ์ธ์." |
| Required packages not installed | "ํ์ํ ํจํค์ง๋ฅผ ์ค์นํด์ฃผ์ธ์: pip install google-api-python-client youtube-transcript-api pyyaml" |
| API quota exceeded | "YouTube API ํ ๋น๋์ด ์ด๊ณผ๋์์ต๋๋ค. ๋ด์ผ ๋ค์ ์๋ํด์ฃผ์ธ์." |