Skip to content

chenyuxiaojin/xiaochen-skills / plugins/cyxj-youtube-topics/skills/cyxj-youtube-topics

cyxj-youtube-topics

Verified

YouTube 选题发现 + 判断。搜索 "Claude Code" 相关最近 48 小时新视频, 去重、按话题聚类、做硬信号 + 字幕内容分析,输出带 verdict(值得做/观望/跟风/跳过)+ 理由 + 差异化切口建议的选题报告。写入 Obsidian 选题库。 触发方式:「YouTube 选题」「找 YouTube 选题」「YouTube 最近有什么」「帮我找找最近的新选题」「跑一下选题发现」「有什么新视频」 边界:只做 YouTube 新视频的选题发现与判断;泛选题、短视频 IP 人群选题、文案式出选题不归本 skill。

FileKindSize
SKILL.mdskill md12.0 KB
backfill_channel_ids.pyscript5.1 KB
chinese_reference.pyscript9.2 KB
paths.pyscript6.9 KB
references/setup.mdmarkdown3.3 KB
requirements.txtmanifest9 B
subtitle_fetcher.pyscript5.8 KB
topic_judge.pyscript8.4 KB
write_topics.pyscript39.5 KB
youtube_search.pyscript29.3 KB

references/setup.md

View on GitHub
# 前置准备:环境变量与依赖(首次使用 / 报缺 key 时读)

配一次永久生效。已经跑通过的机器不需要读本文件;只有首次配置、换机器、
或脚本报 `YOUTUBE_API_KEY`/`APIFY_API_TOKEN` 缺失、403 quotaExceeded 时才回来看。

`${SKILL_DIR}` = `${CLAUDE_PLUGIN_ROOT}/skills/cyxj-youtube-topics`

---

1. **YouTube Data API v3 Key**(必需,可配多个轮询)
   - 在 https://console.cloud.google.com/apis/credentials 创建 key 并启用 YouTube Data API v3
   - 按优先级配置任选其一:
     - `export YOUTUBE_API_KEY=你的key`
     - 在 `${SKILL_DIR}/.env` 写入 `YOUTUBE_API_KEY=你的key`
     - 在 `~/.config/cyxj/.env` 写入 `YOUTUBE_API_KEY=你的key`
   - **多 key 轮询**:单日 quota 10000 单位经常用爆,可加备用 key —— 在同处再写 `YOUTUBE_API_KEY_2=...`、`YOUTUBE_API_KEY_3=...`。脚本 403 quotaExceeded 时自动切下一个 key 重试。⚠️ 备用 key 必须来自**不同的 Google Cloud 项目**才有独立配额,同项目里加几个 key 也是同一份 quota。变量名大小写不敏感、`_2` 和 `2` 都认。

2. **Obsidian 选题库目录**(必需)
   - `export CYXJ_TOPIC_DIR="$HOME/obsidian/灵感库/选题库"`

3. **用户个人档案**(可选,但强烈建议)
   - `export CYXJ_USER_PROFILE="$HOME/obsidian/.../个人档案.md"`
   - 内容应包含:身份定位、内容聚焦方向、目标受众、不做什么、代表作品
   - 有这个文件,判断层能给"差异化切口"建议;没有时降级为客观判断

4. **Apify API Token**(必需,字幕抓取主路径)
   - 注册 apify.com,Settings → API & Integrations → Personal API Token
   - 主路径 Actor:`scrape-creators/best-youtube-transcripts-scraper`(脚本直接按 Actor ID 调用,无需 bookmark)
   - 按优先级配置任选其一:
     - `export APIFY_API_TOKEN=你的token`
     - 在 `${SKILL_DIR}/.env` 写入 `APIFY_API_TOKEN=你的token`
     - 在 `~/.config/cyxj/.env` 写入 `APIFY_API_TOKEN=你的token`
   - Free plan 每月 $5 credit,scrape-creators 约 $0.001/条,每月 600 视频约 $0.6,远在 Free 额度内

5. **Supadata API Key**(可选,fallback 兜底)
   - 注册 supadata.ai,dashboard 拷贝 API key
   - 配置:同 Apify,变量名 `SUPADATA_API_KEY`
   - Free tier 每月 100 credits,应急 fallback 够用
   - 不配置也能跑,只是主路径挂时没兜底(Supadata 是独立服务商、独立 IP 池,与 Apify 不共享额度)

6. **Python 依赖**:`pip install -r requirements.txt`
   - 必需:`requests`
   - 不再需要 `youtube-transcript-api`(主路径已换 Apify 代理,不走 YouTube 内部接口)

## 高级环境变量(可选,从脚本实际行为归纳)

- `CYXJ_STATE_DIR`:覆盖状态目录(话题索引 / 创作者索引 / 判断日志 / `.seen_video_ids.json` 的存放处;默认 `~/Library/Application Support/cyxj-youtube-topics/state`,为避 iCloud 文件锁不放同步目录)
- `CYXJ_TRUSTED_BACKEND`:信任频道直查后端,`youtube_api`(默认)或 `apify`(测试用,不烧 YouTube quota,且会跳过关键词召回)
- `CYXJ_LOOKBACK_HOURS`:召回回看窗口小时数,默认 48,取值范围 1–168
- `CYXJ_PHASE`:两段式 cron 专用;`=1` 时 `write_topics.py` 硬锁拒绝写盘(防廉价模型越界),`=2` 或不设则放行
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall