feat(bilibili,twitter): yt-dlp exits bilibili; OpenCLI joins both
bilibili: - live-verified 2026-06: bilibili 412-blocks yt-dlp in every configuration (latest version, direct, proxied, warmed cookies) while bili-cli works fine without login — so yt-dlp no longer serves this channel (it remains the YouTube backend) - backends = [bili-cli, OpenCLI, B站搜索 API]: bili-cli covers search/hot/rank/video-detail/audio, OpenCLI adds subtitles through the browser session, the search API is the zero-dependency fallback - when a broken candidate is bypassed by a working fallback, its reinstall prescription is appended to the winning message instead of being swallowed - skill docs (social.md + video.md): "do NOT use yt-dlp for bilibili" warning, bili-cli/OpenCLI command groups, curl fallback recipe, B站 audio transcription path via `bili audio` + agent-reach transcribe twitter: - OpenCLI joins as the middle candidate [twitter-cli, OpenCLI, bird] - social.md: explicit 4-step search retry chain (retry → upgrade → OpenCLI → stable-command detour) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -89,12 +89,18 @@ twitter user @username
|
||||
```bash
|
||||
# 搜索推文(Twitter 频繁改 GraphQL 端点,可能 404)
|
||||
twitter search "query" -n 10
|
||||
# 如果 search 返回 404,升级 twitter-cli:pipx upgrade twitter-cli
|
||||
|
||||
# likes(2024 年后只能看自己的,平台限制)
|
||||
twitter likes
|
||||
```
|
||||
|
||||
### search 失败时的重试链(按序执行,成功即停)
|
||||
|
||||
1. 直接重试一次(偶发失败常见):`twitter search "query" -n 10`
|
||||
2. 升级后再试:`pipx upgrade twitter-cli && twitter search "query" -n 10`
|
||||
3. 换 OpenCLI 备选(桌面,复用浏览器登录态):`opencli twitter search "query" -f yaml`
|
||||
4. 都不行就改用 `twitter feed` / `twitter user-posts @somebody` 等稳定命令绕路
|
||||
|
||||
### 重要注意事项
|
||||
|
||||
> **安装**: `pipx install twitter-cli`(确保 v0.8.5+)
|
||||
@@ -103,21 +109,25 @@ twitter likes
|
||||
>
|
||||
> **IP 风控**: 不要在 VPS/数据中心 IP 上频繁调用,尤其是 followers/following,有封号风险。使用住宅代理或本地环境。
|
||||
>
|
||||
> **search 可能失效**: Twitter 频繁修改 GraphQL API,search 命令可能随时返回 404。如遇到,先 `pipx upgrade twitter-cli`。如果最新版仍不行,说明上游还没跟上 Twitter 的改动,用 `twitter feed` 替代。
|
||||
> **OpenCLI 备选**: 桌面装了 OpenCLI 的话,`opencli twitter search/article/user-posts -f yaml` 全套可用(浏览器登录态,无需 cookie 环境变量)。
|
||||
>
|
||||
> **输出格式**: 建议用 `--yaml` 或 `--json` 获得结构化输出,对 AI agent 更友好。
|
||||
|
||||
## B站 / Bilibili
|
||||
|
||||
```bash
|
||||
# 获取视频元数据
|
||||
yt-dlp --dump-json "https://www.bilibili.com/video/BVxxx"
|
||||
> ⚠️ **不要用 yt-dlp 读 B站**(风控已全面 412 拦截,实测无解)。用 bili-cli / OpenCLI。
|
||||
|
||||
# 下载字幕
|
||||
yt-dlp --write-sub --write-auto-sub --sub-lang "zh-Hans,zh,en" --convert-subs vtt --skip-download -o "/tmp/%(id)s" "URL"
|
||||
```bash
|
||||
# 搜索 / 热门 / 视频详情(bili-cli,只读无需登录)
|
||||
bili search "query" --type video -n 5
|
||||
bili hot -n 10
|
||||
bili video BVxxx
|
||||
|
||||
# 字幕(OpenCLI,需桌面 Chrome)
|
||||
opencli bilibili subtitle BVxxx
|
||||
```
|
||||
|
||||
> **注意**: 服务器 IP 可能遇到 412 错误。使用 `--cookies-from-browser chrome` 或配置代理。
|
||||
> 详细命令(音频转写、API 直连兜底)见 [references/video.md](video.md)。
|
||||
|
||||
## V2EX (公开 API)
|
||||
|
||||
|
||||
@@ -50,35 +50,48 @@ agent-reach transcribe ./local_audio.mp3 -o /tmp/transcript.txt
|
||||
> 需要先配置 key:`agent-reach configure groq-key gsk_xxx`(免费,console.groq.com)
|
||||
> 或 `agent-reach configure openai-key sk-xxx`。默认 auto 模式:groq 失败自动降级 openai。
|
||||
|
||||
## B站 / Bilibili (yt-dlp + bili-cli)
|
||||
## B站 / Bilibili(bili-cli 为主,OpenCLI 补字幕)
|
||||
|
||||
### 视频元数据 (yt-dlp)
|
||||
> ⚠️ **不要用 yt-dlp 读 B站**:B站风控已全面 412 拦截 yt-dlp(实测最新版、直连/代理/带 Cookie 全部无效)。yt-dlp 只用于 YouTube。
|
||||
|
||||
### 视频详情/搜索/热门/排行 (bili-cli,只读无需登录)
|
||||
|
||||
```bash
|
||||
yt-dlp --dump-json "https://www.bilibili.com/video/BVxxx"
|
||||
```
|
||||
# 视频详情(标题/UP主/时长/播放互动数据/字幕可用性)
|
||||
bili video BVxxx
|
||||
|
||||
### 字幕 (yt-dlp)
|
||||
|
||||
```bash
|
||||
yt-dlp --write-sub --write-auto-sub --sub-lang "zh-Hans,zh,en" --convert-subs vtt --skip-download -o "/tmp/%(id)s" "URL"
|
||||
```
|
||||
|
||||
### 搜索/热门/排行 (bili-cli)
|
||||
|
||||
```bash
|
||||
# 搜索视频
|
||||
bili search "query" --type video -n 5
|
||||
|
||||
# 热门视频
|
||||
# 热门视频 / 排行榜
|
||||
bili hot -n 10
|
||||
|
||||
# 排行榜
|
||||
bili rank -n 10
|
||||
|
||||
# 下载音频并切分为 ASR-ready WAV(无字幕时配合 agent-reach transcribe 转写)
|
||||
bili audio BVxxx
|
||||
```
|
||||
|
||||
> **412 风控**: 海外 IP 必须提供 Cookie(`--cookies-from-browser chrome` 或 `--cookies /path/to/cookies.txt`),国内 IP 一般不受影响。
|
||||
> **安装 bili-cli**: `pipx install bilibili-cli`,然后 `bili login` 扫码登录。
|
||||
### 字幕 (OpenCLI,需要桌面 Chrome)
|
||||
|
||||
```bash
|
||||
# 字幕逐句带时间轴
|
||||
opencli bilibili subtitle BVxxx
|
||||
|
||||
# OpenCLI 也能搜索/读视频元数据(备选)
|
||||
opencli bilibili search "query" -f yaml
|
||||
opencli bilibili video BVxxx -f yaml
|
||||
```
|
||||
|
||||
### 零配置兜底:搜索 API 直连
|
||||
|
||||
```bash
|
||||
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
|
||||
curl -s -c /tmp/bili_ck.txt -o /dev/null -A "$UA" "https://www.bilibili.com/"
|
||||
curl -s -b /tmp/bili_ck.txt -A "$UA" -e "https://www.bilibili.com/" \
|
||||
"https://api.bilibili.com/x/web-interface/search/all/v2?keyword=QUERY&page=1"
|
||||
```
|
||||
|
||||
> **安装 bili-cli**: `pipx install bilibili-cli`(上游 2026-03 起停更但实测健康;只读场景无需登录,`bili login` 扫码可解锁动态/收藏等个人功能)。
|
||||
|
||||
## 小宇宙播客 / Xiaoyuzhou Podcast
|
||||
|
||||
@@ -111,6 +124,7 @@ agent-reach doctor
|
||||
| 场景 | 推荐工具 |
|
||||
|-----|---------|
|
||||
| YouTube 字幕 | yt-dlp |
|
||||
| B站字幕 | yt-dlp |
|
||||
| B站视频详情/搜索 | bili-cli |
|
||||
| B站字幕 | opencli bilibili subtitle |
|
||||
| 播客转录 | 小宇宙 transcribe.sh |
|
||||
| 无字幕音视频 | agent-reach transcribe |
|
||||
| 无字幕音视频 | agent-reach transcribe(B站音频先 `bili audio`) |
|
||||
|
||||
Reference in New Issue
Block a user