YouTube Daily Digest
CleanCreate a daily YouTube digest task that monitors specified channels, fetches new videos from the last 24 hours, retrieves transcripts via Supadata API, generates AI summaries, and sends a professional HTML email digest.
SKILL.md
---
name: youtube-daily-digest
description: "Create a daily YouTube digest task that monitors specified channels, fetches new videos from the last 24 hours, retrieves transcripts via Supadata API, generates AI summaries, and sends a professional HTML email digest. Triggers: 'youtube daily digest', 'youtube summary task', 'channel digest', 'video digest email'."
metadata:
openclaw:
requires:
env:
- SUPADATA_API_KEY
---
# YouTube Daily Digest Skill
Create a daily automated task that monitors YouTube channels, fetches transcripts, summarizes videos, and delivers a professional HTML email digest.
## Prerequisites
**Required: Supadata API Key**
This skill requires a Supadata API key for fetching YouTube video transcripts.
- Sign up at https://dash.supadata.ai
- Get your API key from the dashboard
- Store it as `SUPADATA_API_KEY` environment variable for the task
Supadata provides reliable YouTube transcript extraction without IP blocking issues that affect cloud environments.
## Usage
When the user wants to set up a daily YouTube digest:
1. Ask for the YouTube channel URLs or handles they want to monitor (e.g., `@lexfridman`, `@allin`)
2. Ask for the recipient email address for the digest
3. Ask for preferred time (default: 8:00 AM in user's timezone)
4. Create a recurring task with this skill's workflow
## Task Setup Workflow
### Step 1: Resolve Channel IDs
For each channel URL/handle provided, resolve to a YouTube channel ID and RSS feed URL:
```python
import requests
import re
def get_channel_rss(channel_url):
# Fetch channel page to extract channel ID
r = requests.get(channel_url, headers={"User-Agent": "Mozilla/5.0"}, timeout=10)
# Try multiple patterns to find channel ID
patterns = [
r'"channelId":"(UC[^"]+)"',
r'"externalId":"(UC[^"]+)"',
]
for pattern in patterns:
match = re.search(pattern, r.text)
if match:
channel_id = match.group(1)
return {
"channel_id": channel_id,
"rss_url": f"https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}"
}
raise ValueError(f"Could not find channel ID for {channel_url}")
```
### Step 2: Create Task Description
Create a task with the following description template, substituting the resolved channels:
---
**Task Description Template:**
Fetch new YouTube videos from the specified channels posted in the last 24 hours, get their transcripts via Supadata API, summarize each one, and send a daily email digest.
## Channels to Monitor
[List resolved channels with their channel_id and rss_url]
## Execution Steps
### 1. Fetch new videos from RSS feeds
For each channel, fetch its RSS feed XML and parse entries published within the last 24 hours.
```python
import requests
import xml.etree.ElementTree as ET
from datetime import datetime, timezone, timedelta
def fetch_new_videos(channels):
cutoff = datetime.now(timezone.utc) - timedelta(hours=24)
new_videos = []
for channel_name, channel_id in channels:
rss_url = f"https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}"
r = requests.get(rss_url, timeout=10)
root = ET.fromstring(r.content)
ns = {"atom": "http://www.w3.org/2005/Atom"}
for entry in root.findall("atom:entry", ns):
published = entry.find("atom:published", ns).text
pub_dt = datetime.fromisoformat(published.replace("Z", "+00:00"))
if pub_dt >= cutoff:
title = entry.find("atom:title", ns).text
vid_id = entry.find("atom:id", ns).text.split(":")[-1]
new_videos.append({
"channel": channel_name,
"title": title,
"video_id": vid_id,
"url": f"https://youtu.be/{vid_id}",
"published": published[:10]
})
return new_videos
```
### 2. Fetch transcripts via Supadata API
```python
import os
api_key = os.environ.get("SUPADATA_API_KEY")
for video in new_videos:
resp = requests.get(
"https://api.supadata.ai/v1/youtube/transcript",
headers={"x-api-key": api_key},
params={"videoId": video["video_id"], "text": "true"},
timeout=30
)
data = resp.json()
video["transcript"] = data.get("content", "")
```
### 3. Summarize each video
For each video with a non-empty transcript, generate a concise summary (5-8 bullet points) covering key topics and insights. If transcript is empty, note "Transcript not available."
### 4. Send professional HTML email digest
**MUST USE HTML FORMAT** - Never send plain text email for this digest.
Send to the configured recipient email with:
- Subject: `YouTube Digest — {Month Day, Year}`
- body_format: `html`
- Use the professional HTML template provided in references/email-template.html
If no new videos found, send brief notification: "No new videos from your subscriptions in the last 24 hours."
## Environment Variables
- SUPADATA_API_KEY: Supadata API key for transcript fetching (required)
---
### Step 3: Schedule the Task
Create a recurring task with schedule (default: "Every day at 8AM" in user's timezone).
Use handler_profile "taskworker".
### Step 4: Store API Key
Ensure SUPADATA_API_KEY is configured for the task/skill.
## HTML Email Template Reference
See references/email-template.html for the complete professional HTML email template to use.
## Notes
- YouTube RSS feeds return max 15 recent videos per channel
- Supadata API has rate limits based on your plan (check https://supadata.ai/pricing)
- Video transcripts may not be available for all videos (private, age-restricted, no captions)
- Task agent should handle empty transcript gracefully
Version History
v1.0.0latest
Initial release - Create daily YouTube channel digest with transcript summaries
Apr 6, 2026
Clean.zip
SHA-256 (latest)
6883097e107439eafb83ebf86dc003d5c50949dde63572bbffa155fbd6843789