YouTube Content Tool When to use Use when the user shares a YouTube URL or video link, asks to summarize a video, requests a transcript, or wants to extract and reformat content from any YouTube video. Transforms transcripts into structured content (chapters, summaries, threads, blog posts). Extract transcripts from YouTube videos and convert them into useful formats. Setup Use with the Python from a PM-prepared Hermes source checkout. The extra declares the helper's dependency; do not install packages into Hermes with raw pip or project-discovering . From that checkout, first follow the isol…

,\n ]\n for pattern in patterns:\n match = re.search(pattern, url_or_id)\n if match:\n return match.group(1)\n return url_or_id\n\n\ndef format_timestamp(seconds: float) -> str:\n \"\"\"Convert seconds to HH:MM:SS or MM:SS format.\"\"\"\n total = int(seconds)\n h, remainder = divmod(total, 3600)\n m, s = divmod(remainder, 60)\n if h > 0:\n return f\"{h}:{m:02d}:{s:02d}\"\n return f\"{m}:{s:02d}\"\n\n\ndef fetch_transcript(video_id: str, languages: list | None = None):\n \"\"\"Fetch transcript segments from YouTube.\n\n Returns a list of dicts with 'text', 'start', and 'duration' keys.\n Compatible with youtube-transcript-api v1.x.\n \"\"\"\n try:\n from youtube_transcript_api import YouTubeTranscriptApi\n except ImportError:\n print(\"Error: youtube-transcript-api not installed. Use the isolated PM helper environment described in youtube-content/SKILL.md.\",\n file=sys.stderr)\n sys.exit(1)\n\n api = YouTubeTranscriptApi()\n if languages:\n result = api.fetch(video_id, languages=languages)\n else:\n result = api.fetch(video_id)\n\n # v1.x returns FetchedTranscriptSnippet objects; normalize to dicts\n return [\n {\"text\": seg.text, \"start\": seg.start, \"duration\": seg.duration}\n for seg in result\n ]\n\n\ndef main():\n parser = argparse.ArgumentParser(description=\"Fetch YouTube transcript as JSON\")\n parser.add_argument(\"url\", help=\"YouTube URL or video ID\")\n parser.add_argument(\"--language\", \"-l\", default=None,\n help=\"Comma-separated language codes (e.g. en,tr). Default: auto\")\n parser.add_argument(\"--timestamps\", \"-t\", action=\"store_true\",\n help=\"Include timestamped text in output\")\n parser.add_argument(\"--text-only\", action=\"store_true\",\n help=\"Output plain text instead of JSON\")\n args = parser.parse_args()\n\n video_id = extract_video_id(args.url)\n languages = [l.strip() for l in args.language.split(\",\")] if args.language else None\n\n try:\n segments = fetch_transcript(video_id, languages)\n except Exception as e:\n error_msg = str(e)\n if \"disabled\" in error_msg.lower():\n print(json.dumps({\"error\": \"Transcripts are disabled for this video.\"}))\n elif \"no transcript\" in error_msg.lower():\n print(json.dumps({\"error\": \"No transcript found. Try specifying a language with --language.\"}))\n else:\n print(json.dumps({\"error\": error_msg}))\n sys.exit(1)\n\n full_text = \" \".join(seg[\"text\"] for seg in segments)\n timestamped = \"\\n\".join(\n f\"{format_timestamp(seg['start'])} {seg['text']}\" for seg in segments\n )\n\n if args.text_only:\n print(timestamped if args.timestamps else full_text)\n return\n\n result = {\n \"video_id\": video_id,\n \"segment_count\": len(segments),\n \"duration\": format_timestamp(segments[-1][\"start\"] + segments[-1][\"duration\"]) if segments else \"0:00\",\n \"full_text\": full_text,\n }\n if args.timestamps:\n result[\"timestamped_text\"] = timestamped\n\n print(json.dumps(result, ensure_ascii=False, indent=2))\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":4107,"content_sha256":"c4edb9f4fdf68e609ed57f22a07f8ef80cf3c00dcb2395a53e6aca99ab177d81"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"YouTube Content Tool","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to use","type":"text"}]},{"type":"paragraph","content":[{"text":"Use when the user shares a YouTube URL or video link, asks to summarize a video, requests a transcript, or wants to extract and reformat content from any YouTube video. Transforms transcripts into structured content (chapters, summaries, threads, blog posts).","type":"text"}]},{"type":"paragraph","content":[{"text":"Extract transcripts from YouTube videos and convert them into useful formats.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Setup","type":"text"}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"terminal","type":"text","marks":[{"type":"code_inline"}]},{"text":" with the Python from a PM-prepared Hermes source checkout. The ","type":"text"},{"text":"youtube","type":"text","marks":[{"type":"code_inline"}]},{"text":" extra declares the helper's dependency; do not install packages into Hermes with raw pip or project-discovering ","type":"text"},{"text":"uv run","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"paragraph","content":[{"text":"From that checkout, first follow the isolated development-home setup in ","type":"text"},{"text":"Package Management","type":"text","marks":[{"type":"link","attrs":{"href":"https://hermes-agent.nousresearch.com/docs/reference/package-management#developer-workflow","title":null}}]},{"text":", then prepare the extra and reactivate before running the helper:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"source ./activate\npython -c \"import pm; pm.sync_venv(['youtube'], explicit=True)\"\nsource ./activate\npython -c \"import youtube_transcript_api; print(youtube_transcript_api.__file__)\"","type":"text"}]},{"type":"paragraph","content":[{"text":"On Windows, use ","type":"text"},{"text":". .\\activate.ps1","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead of ","type":"text"},{"text":"source ./activate","type":"text","marks":[{"type":"code_inline"}]},{"text":". If the terminal runs on a different host or in a sandbox, use an explicitly isolated helper environment there, not the agent's production environment. Run every command below with the interpreter whose import check succeeded.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Helper Script","type":"text"}]},{"type":"paragraph","content":[{"text":"SKILL_DIR","type":"text","marks":[{"type":"code_inline"}]},{"text":" is the directory containing this SKILL.md file. The script accepts any standard YouTube URL format, short links (youtu.be), shorts, embeds, live links, or a raw 11-character video ID.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# JSON output with metadata\npython SKILL_DIR/scripts/fetch_transcript.py \"https://youtube.com/watch?v=VIDEO_ID\"\n\n# Plain text (good for piping into further processing)\npython SKILL_DIR/scripts/fetch_transcript.py \"URL\" --text-only\n\n# With timestamps\npython SKILL_DIR/scripts/fetch_transcript.py \"URL\" --timestamps\n\n# Specific language with fallback chain\npython SKILL_DIR/scripts/fetch_transcript.py \"URL\" --language tr,en","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Output Formats","type":"text"}]},{"type":"paragraph","content":[{"text":"After fetching the transcript, format it based on what the user asks for:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Chapters","type":"text","marks":[{"type":"strong"}]},{"text":": Group by topic shifts, output timestamped chapter list","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Summary","type":"text","marks":[{"type":"strong"}]},{"text":": Concise 5-10 sentence overview of the entire video","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Chapter summaries","type":"text","marks":[{"type":"strong"}]},{"text":": Chapters with a short paragraph summary for each","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Thread","type":"text","marks":[{"type":"strong"}]},{"text":": Twitter/X thread format — numbered posts, each under 280 chars","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Blog post","type":"text","marks":[{"type":"strong"}]},{"text":": Full article with title, sections, and key takeaways","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Quotes","type":"text","marks":[{"type":"strong"}]},{"text":": Notable quotes with timestamps","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Example — Chapters Output","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"00:00 Introduction — host opens with the problem statement\n03:45 Background — prior work and why existing solutions fall short\n12:20 Core method — walkthrough of the proposed approach\n24:10 Results — benchmark comparisons and key takeaways\n31:55 Q&A — audience questions on scalability and next steps","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Workflow","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Fetch","type":"text","marks":[{"type":"strong"}]},{"text":" the transcript using ","type":"text"},{"text":"terminal","type":"text","marks":[{"type":"code_inline"}]},{"text":" and the prepared Python with ","type":"text"},{"text":"--text-only --timestamps","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Validate","type":"text","marks":[{"type":"strong"}]},{"text":": confirm the output is non-empty and in the expected language. If empty, retry without ","type":"text"},{"text":"--language","type":"text","marks":[{"type":"code_inline"}]},{"text":" to get any available transcript. If still empty, tell the user the video likely has transcripts disabled.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Chunk if needed","type":"text","marks":[{"type":"strong"}]},{"text":": if the transcript exceeds ~50K characters, split into overlapping chunks (~40K with 2K overlap) and summarize each chunk before merging.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Transform","type":"text","marks":[{"type":"strong"}]},{"text":" into the requested output format. If the user did not specify a format, default to a summary.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify","type":"text","marks":[{"type":"strong"}]},{"text":": re-read the transformed output to check for coherence, correct timestamps, and completeness before presenting.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Error Handling","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Transcript disabled","type":"text","marks":[{"type":"strong"}]},{"text":": tell the user; suggest they check if subtitles are available on the video page.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Private/unavailable video","type":"text","marks":[{"type":"strong"}]},{"text":": relay the error and ask the user to verify the URL.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"No matching language","type":"text","marks":[{"type":"strong"}]},{"text":": retry without ","type":"text"},{"text":"--language","type":"text","marks":[{"type":"code_inline"}]},{"text":" to fetch any available transcript, then note the actual language to the user.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Dependency missing","type":"text","marks":[{"type":"strong"}]},{"text":": repeat PM preparation and reactivation above, then verify the helper uses that Python. Do not repair the selected generation with pip.","type":"text"}]}]}]}]},"metadata":{"date":"2026-11-02","name":"youtube-content","author":"Teknium (teknium1), Hermes Agent","source":{"stars":259759,"repo_name":"hermes-agent","origin_url":"https://github.com/NousResearch/hermes-agent/blob/HEAD/skills/media/youtube-content/SKILL.md","repo_owner":"NousResearch","body_sha256":"b556a0d2a220b46b80eb011619f0c951404f4d6e2edcc8b4847faec512b55132","cluster_key":"b9f6594db53b40b66b93e06ed85ce674c34fd287cc93931fa60393c3be95c022","clean_bundle":{"format":"clean-skill-bundle-v1","source":"NousResearch/hermes-agent/skills/media/youtube-content/SKILL.md","text_bytes":5366,"source_commit":"013bde4786db7afbd72c44a1d15ee78876c9cb96","skills_sh_rank":19361,"attachment_count":2,"text_attachments":2,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"skills/media/youtube-content/SKILL.md","import_metadata":{"date":"2026-11-02","author":"Teknium (teknium1), Hermes Agent","version":"1.0.0","category":"media-content","category_label":"Media"},"exact_dupes_collapsed_into_this":0},"license":"MIT","version":"1.0.0","category":"media-content","metadata":{"hermes":{"tags":["YouTube","Video","Transcripts","Media"],"related_skills":[]}},"platforms":["linux","macos","windows"],"import_tag":"skills-sh-top20k-2026-11","description":"YouTube transcripts to summaries, threads, blogs."}},"renderedAt":1793671920790}

YouTube Content Tool When to use Use when the user shares a YouTube URL or video link, asks to summarize a video, requests a transcript, or wants to extract and reformat content from any YouTube video. Transforms transcripts into structured content (chapters, summaries, threads, blog posts). Extract transcripts from YouTube videos and convert them into useful formats. Setup Use with the Python from a PM-prepared Hermes source checkout. The extra declares the helper's dependency; do not install packages into Hermes with raw pip or project-discovering . From that checkout, first follow the isol…