Subhadip Sarkar

YouTube Transcript (yt-dlp captions)

数据分析v1.0.5
作者:Subhadip Sarkar更新于 2026-05-17共 6 个版本 · 最新版本发布于 2026-02-14youtube-transcript-yt-dlp@clawhub_itzsubhadip/youtube-transcript-yt-dlp
网页抓取#Sqlite

据 AlphaMoat 统计,截至 2026-09,YouTube Transcript (yt-dlp captions) 累计下载 3,713 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 2,885 位,在「数据分析」分类(399 个)中排名第 219 位。

累计安装
118
累计下载
3,713
星标
-
全站排名
#2,885
全站前 57% · 「数据分析」前 55%
平台累计安装累计下载星标评论
ClawHub ↗1183,707--
SkillHub ↗1173,713-—

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

这个技能是做什么的

该技能使用 yt-dlp,优先手动字幕,再回退到自动字幕;没有字幕时可能尝试 YouTube transcript panel。主文说明此版本不会调用第三方转录服务,只直接访问 YouTube。若需 cookies.txt,必须将 cookies 视为机密。

资料发布于 2026-10-29

可以用来做什么

  • 将 YouTube 字幕转为文本以便总结或搜索
  • 按需保留时间戳或缓存结果

什么时候用

  • 用户提供 YouTube 链接并需要字幕文本或摘要输入时

示例提示词

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

说明此技能如何从现有字幕获取文本,以及字幕缺失时的限制;不要访问视频。

月度数据趋势

累计下载3,713
1,7802,8183,8562026-03 · 累计下载 1,9232026-05 · 累计下载 2,9112026-06 · 累计下载 3,0702026-07 · 累计下载 3,3852026-08 · 累计下载 3,5642026-09 · 累计下载 3,71326-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

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

月份累计下载环比星标
2026-093,713—-
2026-083,564+5.3%-
2026-073,385+10.3%-
2026-063,070+5.5%-
2026-052,911—-
2026-031,923—-

SKILL.md 原文

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

3.8 KB · ClawHub v1.0.5
---
name: yt_transcript
description: Extract YouTube video transcripts from existing captions (manual or auto-generated) using yt-dlp, with optional timestamps and local SQLite caching. Use when the user asks for a YouTube transcript, captions, subtitles, or wants to turn a YouTube link into text for summarization/search.
metadata: {"openclaw":{"requires":{"bins":["python3","yt-dlp"]},"os":["linux","darwin","win32"]}}
user-invocable: true
---

# YouTube Transcript (Captions-Only)

This skill extracts transcripts from **existing** YouTube captions.
展开全部(共 95 行)

**Primary behavior**
- Prefer **manual subtitles** when available.
- Fall back to **auto-generated captions**.
- Output either:
  - **JSON** segments (default) or
  - **plain text** (`--text`)
- Cache results locally in **SQLite** for speed.

**Reliability behavior**
- If YouTube blocks anonymous access (bot-check), provide **cookies.txt**.
- If `yt-dlp` reports no captions for a video, the script tries a fallback:
  1) YouTube’s **transcript panel** (youtubei `get_transcript`) when accessible

This published version intentionally **does not** call third-party transcript providers.

**Privacy note:** This published version only contacts YouTube directly (via `yt-dlp` and the transcript panel fallback). It does **not** send video IDs/URLs to third-party transcript providers.

**Cookies:** Cookies are treated as secrets.
- The script supports `--cookies` / `YT_TRANSCRIPT_COOKIES`, but does **not** auto-load cookies from inside the skill directory.
- Store cookies under `~/.config/yt-transcript/`.

**Path safety:** This skill restricts `--cookies` and `--cache` paths to approved directories.
- cookies allowed under: `~/.config/yt-transcript/`
- cache allowed under: `{baseDir}/cache/` and `~/.config/yt-transcript/`

## How to run

Script path:
- `{baseDir}/scripts/yt_transcript.py`

Typical usage:
- `python3 {baseDir}/scripts/yt_transcript.py <youtube_url_or_id>`
- `python3 {baseDir}/scripts/yt_transcript.py <url> --lang en`
- `python3 {baseDir}/scripts/yt_transcript.py <url> --text`
- `python3 {baseDir}/scripts/yt_transcript.py <url> --no-ts`

Cookies (optional, but often required on VPS IPs):
- `python3 {baseDir}/scripts/yt_transcript.py <url> --cookies /path/to/youtube-cookies.txt`
- or set env var: `YT_TRANSCRIPT_COOKIES=/path/to/youtube-cookies.txt`

**Publishing safety note:** Cookies are optional, so `YT_TRANSCRIPT_COOKIES` is intentionally **not required** by skill metadata. Only set it if you need authenticated access.

**Best practice:** store cookies **outside** the skill folder (so you never accidentally publish them), e.g. `~/.config/yt-transcript/youtube-cookies.txt`, and point to it via `--cookies` or `YT_TRANSCRIPT_COOKIES`.

## What the script returns

### JSON mode (default)
A JSON object:
- `video_id`: 11-char id
- `lang`: chosen language
- `source`: `manual` | `auto` | `panel`
- `segments`: list of `{ start, duration, text }` (or text-only when `--no-ts`)

### Text mode (`--text`)
A newline-separated transcript.
- By default timestamps are included as `[12.34s]`.
- Use `--no-ts` to output only the text lines.

## Caching

Default cache DB:
- `{baseDir}/cache/transcripts.sqlite`

Cache key includes:
- `video_id`, `lang`, `source`, `include_timestamp`, `format`

## Cookie handling (important)

- Cookies must be in **Netscape cookies.txt** format.
- Treat cookies as **secrets**.
- **Never commit / publish cookies** to ClawHub.

Recommended local path (ignored by git/publish):
- `{baseDir}/cache/youtube-cookies.txt` (chmod 600)

## Notes (safety + reliability)

- Only accept a YouTube URL or an 11-character video ID.
- Do not forward arbitrary user-provided flags into the command.
- If `yt-dlp` is missing, instruct the user to install it (recommended):
  - install pipx
  - `pipx install yt-dlp`
  - ensure `yt-dlp` is on PATH

「数据分析」分类下的热门技能

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