Youtube API提取
- 作者仓库星标 3
- 作者仓库 dotnix
YouTube Transcript
Purpose
Fetch a YouTube video's transcript using youtube-transcript-api.
Reference: https://gist.github.com/intellectronica/6178110791dc19a05d7c0173118fd48e
Run
nix-shell -p 'python312.withPackages (ps: [ ps.youtube-transcript-api ])' --run 'python {baseDir}/scripts/get_transcript.py "VIDEO_URL_OR_ID"'
With timestamps:
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:
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_IDhttps://youtu.be/VIDEO_IDhttps://youtube.com/embed/VIDEO_IDhttps://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.
- 流狐分类
- 数据
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @yutakobayashidev · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 检测到的网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Fetch a YouTube video's transcript using youtube-transcript-api. Reference: https://gist.github.com/intellectronica/6178110791dc19a05d7c0173118fd48e
With timestamps: Save to a file:
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.
https://www.youtube.com/watch?v=VIDEOID https://youtu.be/VIDEOID https://youtube.com/embed/VIDEOID
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
## 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. 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Purpose → Run → Output Rules → Supported Inputs → Notes
要点 -> Fetch a YouTube video's transcript using youtube-transcript-api. · - Do not alter transcript wording. · - Captions must be available on the video.
文件/命令 -> youtube-transcript-api · <video-id>-transcript.txt · https://www.youtube.com/watch?v=VIDEOID · https://youtu.be/VIDEOID · https://youtube.com/embed/VIDEOID · https://youtube.com/v/VIDEOID
内容 SHA-256 -> 6dd9775922f7
原文结构
适用与边界
原文中的明确线索
youtube-transcript-api、<video-id>-transcript.txt、https://www.youtube.com/watch?v=VIDEOID、https://youtu.be/VIDEOID、https://youtube.com/embed/VIDEOID、https://youtube.com/v/VIDEOID