--- name: youtube description: Search YouTube videos, retrieve video metadata, and extract full transcripts/subtitles with timestamps for instant AI summarization, recipes, or research. --- # 📺 YouTube Integration (Search & Transcripts) Full YouTube search and transcript extraction engine for OpenClaw: 1. 🔍 **`youtube_search(query, max_results=5, video_duration="any")`**: - Searches YouTube via YouTube Data API v3. - Returns title, channel, video ID, formatted duration, view count, published date, and direct link. - Durations: `any`, `short` (< 4 min), `medium` (4-20 min), `long` (> 20 min). 2. 📜 **`youtube_get_transcript(video_url_or_id, languages=["de", "en"], include_timestamps=True)`**: - **Unlimited & 100% Free**: Powered by `youtube-transcript-api` (zero GCP quota consumption). - Fetches formatted subtitles and speech transcripts with `[MM:SS]` timestamps. - Automatically prioritizes German (`de`) and English (`en`), including auto-generated subtitles. - Perfect for: - Summarizing interviews, podcasts, tech talks, and keynotes. - Extracting cooking steps and recipes from YouTube food videos for `koch`. - Extracting command-line instructions, code, or homelab setup guides for `itguy`. 3. ℹ️ **`youtube_video_details(video_url_or_id)`**: - Fetches full description, tags, view count, like count, and publication details. --- ## 🧭 Prompt Routing & Best Practices - **When the user pastes a YouTube URL** (e.g. *"Was wird in diesem Video erklärt? https://youtu.be/..."* or *"Fass mir das Video kurz zusammen"*): - Do NOT waste a turn searching. Directly call `youtube_get_transcript` with the URL! - Provide a concise executive summary with key takeaways, timestamps for notable moments, and actionable conclusions. - **For Koch / Recipes**: - When the user asks for a recipe from a video, pull the transcript via `youtube_get_transcript`, extract the ingredients and steps, and offer to add missing items to the Bring! shopping list. - **For Research / Recherche**: - Search relevant videos via `youtube_search` to find relevant lectures, documentaries, or news reports, then extract the transcript of the top hit for deep grounded analysis.