成绩单

数据 社区

技能解读

当前原文的自动摘译,尚未人工审校。

目的

使用 youtube-transcript-api 获取 YouTube 视频的文字记录。参考:https://gist.github.com/intellectronica/6178110791dc19a05d7c0173118fd48e

运行

带时间戳:保存到文件:

输出规则

请勿更改文字记录的措辞。如果没有时间戳,如果用户要求可读文本,则可以将行重新换行为完整的段落。使用时间戳,每行保留一个标题段。如果用户要求保存脚本,请将其写入请求的路径。如果未指定输出文件但需要文件,请使用<video-id>-transcript.txt。

支持的输入

https://www.youtube.com/watch?v=VIDEO_ID https://youtu.be/VIDEO_ID https://youtube.com/embed/VIDEO_ID https://youtube.com/v/VIDEO_ID 原始 11 个字符视频 ID

注释

视频上必须有字幕。该脚本首先尝试默认的转录本获取,然后回退到第一个可用的转录本语言。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
数据
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@yutakobayashidev · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
Python
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
  • 命令执行
网络行为
允许外网请求
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# YouTube Transcript

## Purpose

Fetch a YouTube video's transcript using `youtube-transcript-api`.

Reference: https://gist.github.com/intellectronica/6178110791dc19a05d7c0173118fd48e

## Run

```bash
nix-shell -p 'python312.withPackages (ps: [ ps.youtube-transcript-api ])' --run 'python {baseDir}/scripts/get_transcript.py "VIDEO_URL_OR_ID"'
```

With timestamps:

```bash
nix-shell -p 'python312.withPackages (ps: [ ps.youtube-transcript-api ])' --run 'python {baseDir}/scripts/get_transcript.py "VIDEO_URL_OR_ID" --timestamps'
```

Save to a file:

```bash
nix-shell -p 'python312.withPackages (ps: [ ps.youtube-transcript-api ])' --run 'python {baseDir}/scripts/get_transcript.py "VIDEO_URL_OR_ID" --timestamps' > transcript.txt
```

## Output Rules

- Do not alter transcript wording.
- Without timestamps, it is acceptable to rewrap lines into complete paragraphs if the user asked for readable text.
- With timestamps, preserve one caption segment per line.
- If the user asks to save the transcript, write it to the requested path.
- If no output file is specified but a file is needed, use `<video-id>-transcript.txt`.

## Supported Inputs

- `https://www.youtube.com/watch?v=VIDEO_ID`
- `https://youtu.be/VIDEO_ID`
- `https://youtube.com/embed/VIDEO_ID`
- `https://youtube.com/v/VIDEO_ID`
- Raw 11-character video ID

## Notes

- Captions must be available on the video.
- The script first tries the default transcript fetch, then falls back to the first available transcript language.

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。