技能图谱SKILLSGROVE
技能图谱/短视频与自媒体/jacardl/viceroy-skills/youtube-transcript

youtube-transcript

安装

$npx skills add https://github.com/jacardl/viceroy-skills --skill youtube-transcript
$git clone --depth 1 https://github.com/jacardl/viceroy-skills.git /tmp/viceroy-skills && mkdir -p ~/.claude/skills && cp -r /tmp/viceroy-skills/skills/assistant/youtube-transcript ~/.claude/skills/youtube-transcript
请帮我安装这个 Agent Skill:https://github.com/jacardl/viceroy-skills/tree/afd7a6af100c93257bea3eefc7860157554f1752/skills/assistant/youtube-transcript ,先阅读它的 SKILL.md 和脚本,确认安全后再安装到我的技能目录。

简介

原文描述 · MITExtract transcripts from YouTube videos. Use when the user asks for a transcript, subtitles, or captions of a YouTube video and provides a YouTube URL (youtube.com/watch?v=, youtu.be/, or similar). Supports output with or without timestamps.
以下 SKILL.md 内容转载自 jacardl/viceroy-skills(提交 afd7a6a),依据 MIT 许可证转载正文(文字未改动;仅省略文件头元数据、将图片显示为链接,超长内容会截断);版权归 2024 佳哥 (jacardl) 所有。许可证:LICENSE。仅展示说明文件,附带脚本请在原仓库查看。

YouTube Transcript

Extract transcripts from YouTube videos using the youtube-transcript-api.

Usage

Run the script with a YouTube URL or video ID:

uv run scripts/get_transcript.py "VIDEO_URL_OR_ID"

With timestamps:

uv run scripts/get_transcript.py "VIDEO_URL_OR_ID" --timestamps

Defaults

  • Without timestamps (default): Plain text, one line per caption segment
  • With timestamps: [MM:SS] text format (or [HH:MM:SS] for longer videos)

Supported URL Formats

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID
  • https://youtube.com/embed/VIDEO_ID
  • Raw video ID (11 characters)

Output

  • CRITICAL: YOU MUST NEVER MODIFY THE RETURNED TRANSCRIPT
  • If the transcript is without timestamps, you SHOULD clean it up so that it is arranged by complete paragraphs and the lines don't cut in the middle of sentences.
  • If you were asked to save the transcript to a specific file, save it to the requested file.
  • If no output file was specified, use the YouTube video ID with a -transcript.txt suffix.

Notes

  • Fetches auto-generated or manually added captions (whichever is available)
  • Requires the video to have captions enabled
  • Falls back to auto-generated captions if manual ones aren't available
查看许可证全文(MIT)
MIT License

Copyright (c) 2024 佳哥 (jacardl)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.