
Yt Search Download
Search YouTube, download videos or MP3, and pull subtitles when a solo builder is researching topics or stocking media for content and product work.
Overview
yt-search-download is an agent skill most often used in Grow (also Idea, Validate) that searches YouTube via API v3 and downloads video, audio, or subtitles with yt-dlp.
Install
npx skills add https://github.com/joeseesun/yt-search-download --skill yt-search-downloadWhat is this skill?
- YouTube Data API v3 keyword search with sort by relevance, date, or viewCount
- Channel browse and latest-video listing for named creators or brands
- yt-dlp downloads for video, MP3 audio extraction, and SRT/VTT subtitles (ZH/EN)
- CLI wrapper `yt_search.py` with flags for count, API sort, and local re-sort by views or duration
- Broad trigger coverage whenever messages mention YouTube, 油管, YT, or yt with search/download/subtitle actions
- Combines YouTube Data API v3 with yt-dlp for search and download
- Default search result cap of 20 items via `-n` parameter
Adoption & trust: 696 installs on skills.sh; 109 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need YouTube search, channel discovery, or local copies of video, audio, or subtitles without bouncing between the site, separate CLIs, and copy-paste URLs.
Who is it for?
Solo builders doing content repurposing, competitive video research, or offline reference libraries from YouTube.
Skip if: Teams that need compliant bulk redistribution, server-side streaming pipelines, or workflows with no Google API key and no willingness to install yt-dlp locally.
When should I use this skill?
User messages mention YouTube, 油管, YT, or yt with search, download, subtitle, channel, or video actions—including 搜索, 下载, 字幕, 频道, and MP3 extraction phrasing.
What do I get? / Deliverables
You get ranked search results, channel lists, and saved media or subtitle files from one scripted workflow driven by natural-language triggers in the agent.
- Ranked YouTube search or channel result lists
- Downloaded video, MP3, or subtitle files on local disk
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Grow because the skill’s output—downloaded media, transcripts, and channel intelligence—most often feeds content pipelines, repurposing, and distribution rather than core app code. Content subphase matches search, channel browsing, subtitle extraction, and save-to-disk workflows that creators and marketers run after they are building toward launch.
Where it fits
Search a niche keyword on YouTube sorted by viewCount to see which formats and creators dominate before you commit to a build.
Pull subtitles from reference videos to quote pain points and scope a landing page or demo script.
Download audio and transcripts from your own or competitor uploads for newsletters, clips, or SEO briefs.
How it compares
Use this skill package for agent-driven YouTube API plus yt-dlp orchestration, not a generic browser bookmarklet or a hosted video SaaS.
Common Questions / FAQ
Who is yt-search-download for?
Indie builders and one-person marketing stacks who want Claude Code or similar agents to search YouTube, pull channel updates, and save video, MP3, or subtitles in one flow.
When should I use yt-search-download?
Use it in Grow when stocking content assets, in Idea when researching what competitors publish on YouTube, and in Validate when you need transcripts or examples to scope a product or landing narrative.
Is yt-search-download safe to install?
It needs network access, shell execution, filesystem writes, and a YouTube API key—review the Security Audits panel on this Prism page and treat API keys and downloaded media as sensitive before running in shared environments.
SKILL.md
READMESKILL.md - Yt Search Download
# YouTube 搜索 & 下载 基于 YouTube Data API v3 进行高级搜索,配合 yt-dlp 下载。 ## 前置条件 1. **YouTube API Key**: ```bash echo $YT_BROWSE_API_KEY ``` 如果为空:[Google Cloud Console](https://console.cloud.google.com/) → 启用 YouTube Data API v3 → 创建 API Key → 写入 `~/.zshrc`: ```bash export YT_BROWSE_API_KEY=your_key ``` 2. **yt-dlp**(下载用): ```bash brew install yt-dlp # macOS pip install yt-dlp # 或 pip 安装 ``` ## 命令说明 脚本路径:`~/.claude/skills/yt-search-download/scripts/yt_search.py` ### 全站关键词搜索 ```bash python3 scripts/yt_search.py search "关键词" -n 20 ``` | 参数 | 说明 | |------|------| | `-n 20` | 最多返回条数(默认 20) | | `-o date` | 按时间排序(默认 relevance) | | `-o viewCount` | 按播放量排序(API 级,准确) | | `--sort-by views` | 本地二次排序(按播放量降序) | | `--sort-by duration-asc` | 本地排序:时长从短到长 | | `--sort-by duration-desc` | 本地排序:时长从长到短 | | `--min-duration 30m` | 过滤:最短时长(支持 `30m`、`1h`、`1h30m`、纯数字=分钟) | | `--max-duration 1h` | 过滤:最长时长 | | `--after 2024-01-01` | 发布时间起 | | `--before 2024-12-31` | 发布时间止 | | `-c @handle` | 限定频道 | | `-d` | 显示简介 | | `--json` | JSON 格式输出 | ### 浏览频道视频 ```bash # 频道最新视频(按时间倒序) python3 scripts/yt_search.py channel @channelHandle -n 10 # 频道内关键词搜索 python3 scripts/yt_search.py channel @channelHandle -q "关键词" # 频道内按播放量排序 python3 scripts/yt_search.py channel @channelHandle -o viewCount # 只看长视频(超过 1 小时) python3 scripts/yt_search.py channel @channelHandle --min-duration 1h # 只看短视频(30 分钟内),按时长升序 python3 scripts/yt_search.py channel @channelHandle --max-duration 30m --sort-by duration-asc ``` 频道格式支持:`@handle`、`https://youtube.com/@handle`、频道 ID(`UCxxxx`) ### 下载视频 ```bash # 最佳画质下载到 ~/Downloads python3 scripts/yt_search.py download "VIDEO_URL" # 指定画质 python3 scripts/yt_search.py download "VIDEO_URL" -q 1080p # 指定目录 python3 scripts/yt_search.py download "VIDEO_URL" --dir ~/Desktop # 仅下载音频(MP3) python3 scripts/yt_search.py download "VIDEO_URL" --audio-only ``` ### 视频详情查询 ```bash python3 scripts/yt_search.py info "VIDEO_URL" ``` ## 输出格式(Markdown 表格) 脚本已输出 Markdown 表格,AI **必须将每行的 `【译】___` 替换为实际中文翻译**后再呈现给用户。 最终呈现效果: | # | 标题(原文 → 中文译文) | 日期 | 时长 | 播放量 | |---|------------------------|------|------|--------| | 1 | [Rick Beato: Greatest Guitarists...](url)<br>里克·贝阿托:史上最伟大的吉他手 | 2026-03-01 | 2h33m | 302.2K | | 2 | [State of AI in 2026: LLMs, Coding...](url)<br>2026年AI现状:大模型、编程、Scaling法则 | 2026-01-31 | 4h25m | 741.7K | **🔴 强制规范**: - ✅ 保留原英文标题(作为可点击链接) - ✅ `【译】___` 替换为简洁中文译文(放在链接后同一单元格) - ✅ 所有视频逐行翻译,不得跳过 - ❌ 不询问用户是否需要翻译(直接翻译) - ❌ 不把 `【译】___` 原样输出给用户 ## 典型工作流 **找某频道最新视频并下载:** 1. `channel @handle -n 10` → 浏览结果 2. 问用户要下载哪个 3. `download "URL"` → 保存到 ~/Downloads **搜索 + 按播放量筛选:** 1. `search "关键词" -o viewCount -n 20` **提取播客音频:** 1. `search "播客名" -o date -n 5` 2. `download "URL" --audio-only` ### 下载字幕(默认同时输出 SRT + TXT) **标准流程**:下载字幕转为 SRT,同时生成保留时间戳的 TXT(供 AI 总结用,时间戳有助于定位内容)。 ```bash # Step 1:下载字幕并转为 SRT(英文优先,无则用自动字幕) yt-dlp --cookies-from-browser chrome \ --write-auto-sub --write-sub \ --sub-lang en,zh-Hans \ --convert-subs srt \ --skip-download \ -o "~/Downloads/%(title)s.%(ext)s" \ "VIDEO_URL" # 输出:~/Downloads/视频标题.en.srt 或 .zh-Hans.srt # Step 2:从 SRT 生成 TXT(保留时间戳,仅去除序号和空行,供 AI 总结使用) python3 -c " import re, sys srt = open(sys.argv[1]).read() # 去除序号行(纯数字行),保留时间戳和字幕文本 txt = re.sub(r'^\d+\s*\n', '', srt,