B站小红书 Content Pipeline — URL to Markdown
Project description
自古红蓝出 CP —— 把 B 站和小红书内容转成本地 Markdown 知识库
粘一个链接,得到一篇 Markdown。支持 B 站视频、小红书视频、小红书图文,自动转录/识别文字,多人对谈标注说话人。还能批量下载整个博主、连评论一起存。
快速开始
前置:Python ≥ 3.11,百炼 API Key(ASR / VLM 用)。
1. 安装
# 推荐:从 PyPI 装,命令直接是 rbcp
pipx install red-blue-cp
# 或源码安装(开发用)
git clone https://github.com/MuChengZJU/red-blue-cp.git
cd red-blue-cp && uv sync
2. 配置
# PyPI 安装:配置文件放 ~/.config/rbcp/.env
mkdir -p ~/.config/rbcp && cp .env.example ~/.config/rbcp/.env
# 源码安装:配置文件放仓库根目录
cp .env.example .env
编辑 .env,填入 DASHSCOPE_API_KEY。单篇公开内容只需这一个 key。
3. 使用
# 打开网页界面(推荐)
rbcp serve # 浏览器访问 http://localhost:8000
# 或命令行直接转
rbcp run "B站或小红书链接"
源码安装的命令前加
uv run,如uv run rbcp serve。
功能
- 视频转录 — B 站视频优先取字幕,无字幕走 ASR(百炼 Paraformer)
- 图文识别 — 小红书图文用 VLM(百炼 Qwen-VL)识别图片内容
- 说话人分离 — 多人对谈自动标注「说话人 1 / 2 / ...」
- 博主批量下载 —
rbcp fetch "<博主主页>" --all,先预览再确认 - 评论提取 —
rbcp fetch "<笔记链接>" --comments,含楼中楼 - 扫码登录 —
rbcp login弹浏览器扫码,cookie 本地复用
博主批量和评论功能需要登录态 + 系统安装 Chrome/Edge。
给 AI Agent 用
rbcp 把 B 站和小红书统一成了结构化接口。AI Agent 可以直接调 CLI 做内容调研——拿博主清单、按规则筛选、逐条下载、读取 Markdown 结果,整个流程无需人工介入。
# Agent 典型工作流:
rbcp list "<博主主页>" --json # 1. 拿到博主全部笔记清单(结构化 JSON)
rbcp fetch "<笔记链接>" --json # 2. 逐条下载,拿到 Markdown 路径
rbcp fetch "<博主主页>" --all --json --yes # 或直接整个博主批量下
所有命令加 --json 即输出机器可读的 JSON。字段契约和完整性标记(complete: true/false,区分"拉全了"还是"被风控截断")见 SPEC.md。
WebUI
网页界面支持桌面和移动端。粘贴链接提交后可实时查看任务状态,完成后直接预览渲染好的 Markdown。
开发
uv sync # 安装依赖
uv run pytest # 跑测试
uv run rbcp serve # 本地起服务
技术栈:FastAPI + Jinja2 + HTMX + Typer + SQLite + asyncio。博主批量/评论用 pydoll(CDP 连系统 Chrome)。
app/
├── service/ # 核心逻辑:抓取、转录、Markdown 生成、存储
├── web/ # WebUI + REST API
└── cli.py # CLI 入口
文档
| 文档 | 内容 |
|---|---|
| PRD.md | 产品需求、定位、排期 |
| SPEC.md | 技术规格、API、数据模型 |
| PLAN.md | 里程碑进度 |
| LOG.md | 演进日志(决策 / 开发 / 经验) |
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file red_blue_cp-0.4.0.tar.gz.
File metadata
- Download URL: red_blue_cp-0.4.0.tar.gz
- Upload date:
- Size: 4.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a361295f2557630824e4cbf43c6aeb6883027aeae8cb614f9f1aa0595ef815d
|
|
| MD5 |
4e168a459894df1e7c346fb39b9f119f
|
|
| BLAKE2b-256 |
d4511d24534295dd911cbc678b6289923a045067a7b99c6a71adc3cccc84173d
|
Provenance
The following attestation bundles were made for red_blue_cp-0.4.0.tar.gz:
Publisher:
publish.yml on MuChengZJU/red-blue-cp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
red_blue_cp-0.4.0.tar.gz -
Subject digest:
0a361295f2557630824e4cbf43c6aeb6883027aeae8cb614f9f1aa0595ef815d - Sigstore transparency entry: 1739809396
- Sigstore integration time:
-
Permalink:
MuChengZJU/red-blue-cp@33632b049a93580115da333a253e1128d99c4f73 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/MuChengZJU
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@33632b049a93580115da333a253e1128d99c4f73 -
Trigger Event:
push
-
Statement type:
File details
Details for the file red_blue_cp-0.4.0-py3-none-any.whl.
File metadata
- Download URL: red_blue_cp-0.4.0-py3-none-any.whl
- Upload date:
- Size: 71.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
224a858beb8c1f8d715c7a6a8d875e9fda3911d3e682118c8bd9b6619bfcde4e
|
|
| MD5 |
04aa0e3a2c1436e2a543fdbf1fd1a015
|
|
| BLAKE2b-256 |
5e6ff2dc497a7aea8a1107aadd588d481758980f1fc1d999f56725d2d854fa31
|
Provenance
The following attestation bundles were made for red_blue_cp-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on MuChengZJU/red-blue-cp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
red_blue_cp-0.4.0-py3-none-any.whl -
Subject digest:
224a858beb8c1f8d715c7a6a8d875e9fda3911d3e682118c8bd9b6619bfcde4e - Sigstore transparency entry: 1739809435
- Sigstore integration time:
-
Permalink:
MuChengZJU/red-blue-cp@33632b049a93580115da333a253e1128d99c4f73 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/MuChengZJU
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@33632b049a93580115da333a253e1128d99c4f73 -
Trigger Event:
push
-
Statement type: