vistalyq

在线视频转文字稿

办公效率v1.0.1
作者:vistalyq更新于 2026-05-11共 2 个版本 · 最新版本发布于 2026-03-11video2txt@clawhub_vistalyq/video2txt
文档处理

据 AlphaMoat 统计,截至 2026-09,在线视频转文字稿 累计下载 1,580 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 4,716 位,在「办公效率」分类(435 个)中排名第 383 位。

累计安装
185
累计下载
1,580
星标
-
全站排名
#4,716
全站前 93% · 「办公效率」前 89%
平台累计安装累计下载星标评论
ClawHub ↗24906--
SkillHub ↗1851,580-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

文档要求先用 yt-dlp 获取可用字幕,再按视频语言选择输出:非中文视频生成原文和中文译文,中文视频生成一份文档;没有可用字幕时应说明限制。

资料发布于 2026-10-27

可以用来做什么

  • 从支持的平台视频链接提取字幕
  • 为非中文视频整理原文及中文译文文档

什么时候用

  • 用户提供视频链接并需要字幕或讲稿文本时
  • 需要把视频内容整理为 DOCX 文件时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

检查这个视频是否有可用字幕并整理成文档
把这段非中文视频的字幕整理为原文和中文两个 DOCX

月度数据趋势

累计下载1,580
2479631,6792026-03 · 累计下载 3462026-05 · 累计下载 6182026-06 · 累计下载 7542026-07 · 累计下载 9932026-08 · 累计下载 1,1772026-09 · 累计下载 1,58026-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-091,580—-
2026-081,177+18.5%-
2026-07993+31.7%-
2026-06754+22.0%-
2026-05618—-
2026-03346—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

5.6 KB · ClawHub v1.0.1
---
name: video-transcript
version: 1.0.0
description: Extract transcripts/subtitles from video URLs and deliver as .docx files. Use this skill whenever the user provides a video link (YouTube, Bilibili, or any yt-dlp supported platform) and asks for a transcript, subtitles, lecture notes, or spoken content in text form. Also trigger when user says "帮我把这个视频转成文字", "视频讲稿", "字幕文档", "transcript", "lecture notes from video", or pastes a video URL with any request to get the text content.
compatibility:
  tools:
    - exec
  dependencies:
    - name: yt-dlp
      install: "pip install yt-dlp  # or: winget install yt-dlp"
展开全部(共 159 行)
      check: "yt-dlp --version"
    - name: node
      install: "https://nodejs.org"
      check: "node --version"
    - name: docx (npm, local)
      install: "cd ~/.agents/skills/video-transcript/scripts && npm install"
      check: "node -e \"require('./node_modules/docx')\""
---

# Video Transcript Skill

Extract subtitles from a video URL and deliver clean .docx transcript files.
For non-Chinese videos, produce two files: original language + Chinese translation.
For Chinese videos, produce one file.

## Workflow

### Step 0 — First-time setup (once only)

Check if `node_modules` exists in the scripts directory. If not, run:

```powershell
$skillScripts = "$env:USERPROFILE\.agents\skills\video-transcript\scripts"
if (-not (Test-Path "$skillScripts\node_modules\docx")) {
    Push-Location $skillScripts
    npm install
    Pop-Location
}
```

### Step 1 — Download subtitles with yt-dlp

Run in a temp directory (use `$env:TEMP\vt_<random>` on Windows):

```powershell
$tmp = "$env:TEMP\vt_$(Get-Random)"
New-Item -ItemType Directory -Force $tmp | Out-Null
```

**YouTube:**
```powershell
# Try manual subs first, fall back to auto-generated
yt-dlp --skip-download --write-subs --write-auto-subs --sub-langs "en,zh-Hans,zh-Hant,zh" --convert-subs srt -o "$tmp\sub" "<URL>"
```

**Bilibili:**
```powershell
yt-dlp --skip-download --write-subs --sub-langs "zh-Hans,zh,ai-zh" --convert-subs srt -o "$tmp\sub" "<URL>"
```

**Other platforms:** Use the same YouTube command — yt-dlp handles most platforms automatically.

After download, list what was fetched:
```powershell
Get-ChildItem $tmp -Filter "*.srt"
```

### Step 2 — Detect available subtitle files

Pick the best available file:
- Prefer manual subs over auto-generated (`.en.srt` over `.en-orig.srt` or `.en-auto.srt`)
- For Bilibili: pick `zh-Hans` or `ai-zh`
- If multiple languages exist, note them all

If NO subtitle file was downloaded:
- Tell the user: "该视频没有可用字幕,yt-dlp 无法提取文字内容。如需转录请使用 Whisper 语音识别(需额外安装)。"
- Stop here.

### Step 3 — Parse SRT to plain text

Read the .srt file and strip all timing/index lines. Keep only the spoken text lines.

SRT format to strip:
```
1
00:00:01,000 --> 00:00:03,500
This is the spoken text.

2
00:00:04,000 --> 00:00:06,000
More text here.
```

Output: plain text, one paragraph per subtitle block, blank lines between blocks removed (merge into flowing paragraphs). Also strip HTML tags like `<i>`, `<b>`, `<font ...>`.

Do this parsing yourself by reading the file content — no external tool needed.

### Step 4 — Translate if needed

Detect the subtitle language:
- If **Chinese** (zh, zh-Hans, zh-Hant): skip translation, one file only
- If **other language**: translate the full plain text to Chinese using your own translation capability

Translation guidelines:
- Produce natural, readable Chinese — not word-for-word
- Preserve paragraph structure
- Keep proper nouns, technical terms transliterated or explained inline if needed
- Do NOT add commentary or summaries — pure translation only

### Step 5 — Generate .docx files

Use the bundled script. The script path is:
`~/.agents/skills/video-transcript/scripts/make_docx.js`

Get the video title from yt-dlp output or use a sanitized version of the URL as fallback.

**For non-Chinese video (two files):**
```powershell
# Original
node "~/.agents/skills/video-transcript/scripts/make_docx.js" "$tmp\transcript_original.docx" "<VideoTitle> - Original" "<plain_text>"

# Chinese translation
node "~/.agents/skills/video-transcript/scripts/make_docx.js" "$tmp\transcript_zh.docx" "<VideoTitle> - 中文译稿" "<chinese_text>"
```

**For Chinese video (one file):**
```powershell
node "~/.agents/skills/video-transcript/scripts/make_docx.js" "$tmp\transcript_zh.docx" "<VideoTitle> - 讲稿" "<plain_text>"
```

For long texts, write content to a temp `.txt` file first and pipe it:
```powershell
$plain | Out-File -Encoding utf8 "$tmp\content.txt"
Get-Content "$tmp\content.txt" -Raw | node "~/.agents/skills/video-transcript/scripts/make_docx.js" "$tmp\transcript_original.docx" "<title>"
```

### Step 6 — Deliver to user

Tell the user the output file paths clearly:
- "原文讲稿:`C:\...\transcript_original.docx`"
- "中文译稿:`C:\...\transcript_zh.docx`"

Optionally show a short preview (first 200 chars) of the extracted text so the user can verify quality.

## Error handling

| Situation | Action |
|---|---|
| No subtitles found | Inform user, suggest Whisper as alternative |
| yt-dlp not found | `yt-dlp --version` to check; tell user to install if missing |
| node/docx error | Show error, check if `docx` npm package is installed globally |
| Private/geo-blocked video | Inform user the video is inaccessible |

## Notes

- Always clean up `$tmp` dir after delivering files, or leave it and tell the user the path
- The `make_docx.js` script resolves `docx` from global npm automatically
- For very long videos, translation may take a moment — let the user know

「办公效率」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。