成绩单
- 作者仓库星标 3
- 作者仓库 dotnix
- 领域
- 数据
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @yutakobayashidev · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# 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.
章节与文件索引
按说明文件中的顺序排列。
目的
运行
输出规则
支持的输入
注释
文件/命令 -> youtube-transcript-api · <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
内容校验值 -> 6dd9775922f7
当前原文的自动摘译,尚未人工审校。
目的
使用
youtube-transcript-api获取 YouTube 视频的文字记录。参考:https://gist.github.com/intellectronica/6178110791dc19a05d7c0173118fd48e运行
带时间戳:保存到文件:
输出规则
请勿更改文字记录的措辞。如果没有时间戳,如果用户要求可读文本,则可以将行重新换行为完整的段落。使用时间戳,每行保留一个标题段。如果用户要求保存脚本,请将其写入请求的路径。如果未指定输出文件但需要文件,请使用
<video-id>-transcript.txt。支持的输入
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://youtube.com/embed/VIDEO_IDhttps://youtube.com/v/VIDEO_ID原始 11 个字符视频 ID注释
视频上必须有字幕。该脚本首先尝试默认的转录本获取,然后回退到第一个可用的转录本语言。