youtube-comments-fetch
Fetch YouTube public comment threads and replies for discovered or provided video IDs in configurable UTC time windows with retries, throttling, transport checks, and structure validation. Use when tasks need YouTube public-language datasets after domain video discovery, especially as a complement to official-language sources such as GDELT or Regulations.gov.
What this skill does
# YouTube Comments Fetch ## Core Goal - Fetch public YouTube comment threads with `commentThreads.list`. - Optionally expand replies with `comments.list`. - Filter comments by configurable UTC time windows using `published` or `updated` timestamps. - Return machine-readable JSON and optionally save JSONL artifacts. - Keep execution observable with structured logs and optional log file. ## Required Environment - Configure runtime via environment variables (see `references/env.md`). - Start from `assets/config.example.env` and keep real secrets in `assets/config.env`. - Load env values before running commands: ```bash set -a source assets/config.env set +a ``` ## Workflow 1. Validate effective configuration. ```bash python3 scripts/youtube_comments_fetch.py check-config --pretty ``` 2. Dry-run a fetch plan against candidate video IDs first. ```bash python3 scripts/youtube_comments_fetch.py fetch \ --video-ids-file ./data/youtube-videos/candidates.jsonl \ --start-datetime 2026-03-01T00:00:00Z \ --end-datetime 2026-03-08T00:00:00Z \ --max-videos 5 \ --max-thread-pages 3 \ --dry-run \ --pretty ``` 3. Fetch comments and save JSONL artifacts. ```bash python3 scripts/youtube_comments_fetch.py fetch \ --video-ids-file ./data/youtube-videos/candidates.jsonl \ --start-datetime 2026-03-01T00:00:00Z \ --end-datetime 2026-03-08T00:00:00Z \ --time-field published \ --include-replies \ --order time \ --max-videos 10 \ --max-thread-pages 10 \ --max-reply-pages 20 \ --max-comments 2000 \ --output-dir ./data/youtube-comments \ --log-level INFO \ --log-file ./logs/youtube-comments-fetch.log \ --pretty ``` ## Built-in Robustness - Retry transient failures with exponential backoff. - Respect `Retry-After` and fail fast when it exceeds configured cap. - Throttle request rate with a minimum request interval. - Enforce safety caps: - max videos - max thread pages - max reply pages - max threads - max comments - Validate transport: - JSON content-type - UTF-8 decode - JSON object parse - Validate structure: - thread/comment response shape - comment IDs and parent linkage - datetime fields - duplicate comment suppression - Preserve item-level failures and validation issues in JSON output and optional quarantine files. ## Scope Decision - Keep one atomic operation: comment fetch for known/discovered video IDs. - Accept upstream video IDs from CLI or from `$youtube-video-search` JSON/JSONL outputs. - Do not perform video discovery in this skill. - Do not embed scheduler/polling loops. ## References - `references/env.md` - `references/youtube-comments-api-notes.md` - `references/youtube-limitations.md` - `references/openclaw-chaining-templates.md` ## Script - `scripts/youtube_comments_fetch.py` ## OpenClaw Invocation Compatibility - Keep trigger metadata in `name`, `description`, and `agents/openai.yaml`. - Invoke with `$youtube-comments-fetch`. - Keep the skill atomic: each invocation consumes one configured ID set and time window. - Prefer chaining from `$youtube-video-search` output via `--video-ids-file`. - Surface `reply_window_completeness` to downstream agents when replies are requested. ## OpenClaw Prompt Templates Use these templates directly in OpenClaw and only replace bracketed placeholders. 1. Recon (dry-run) ```text Use $youtube-comments-fetch. Run: python3 scripts/youtube_comments_fetch.py fetch \ --video-ids-file [VIDEO_IDS_FILE] \ --start-datetime [YYYY-MM-DDTHH:MM:SSZ] \ --end-datetime [YYYY-MM-DDTHH:MM:SSZ] \ --max-videos [N] \ --max-thread-pages [M] \ --dry-run \ --pretty Return only the JSON result. ``` 2. Fetch (windowed comments) ```text Use $youtube-comments-fetch. Run: python3 scripts/youtube_comments_fetch.py fetch \ --video-ids-file [VIDEO_IDS_FILE] \ --start-datetime [YYYY-MM-DDTHH:MM:SSZ] \ --end-datetime [YYYY-MM-DDTHH:MM:SSZ] \ --time-field published \ --include-replies \ --order time \ --max-videos [N] \ --max-thread-pages [M] \ --max-reply-pages [R] \ --max-comments [K] \ --output-dir [OUTPUT_DIR] \ --pretty Return only the JSON result. ``` 3. Validate (quality gate) ```text Use $youtube-comments-fetch. Run: python3 scripts/youtube_comments_fetch.py fetch \ --video-ids-file [VIDEO_IDS_FILE] \ --start-datetime [YYYY-MM-DDTHH:MM:SSZ] \ --end-datetime [YYYY-MM-DDTHH:MM:SSZ] \ --max-videos 1 \ --max-thread-pages 1 \ --max-reply-pages 1 \ --max-comments 50 \ --pretty Check validation_summary.total_issue_count, failures, and fetch_summary.record_count. Return JSON plus one-line pass/fail verdict. ```
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.