自用 TVBox 线路配置生成工具
tvbox.json(不含 R18)
- GitHub: https://raw.githubusercontent.com/FanchangWang/tvbox_config/main/dist/tvbox.json
- 代理: https://fastly.jsdelivr.net/gh/FanchangWang/tvbox_config@main/dist/tvbox.json
my.json(含 R18)
- GitHub: https://raw.githubusercontent.com/FanchangWang/tvbox_config/main/dist/my.json
- 代理: https://fastly.jsdelivr.net/gh/FanchangWang/tvbox_config@main/dist/my.json
tvbox_config/
├── config/ # 配置文件
│ ├── sources.yaml # 源列表配置
│ └── history.yaml # 历史记录(自动生成)
├── dist/ # 生成的 JSON 文件
│ ├── tvbox.json # 不含 R18
│ └── my.json # 含 R18
├── src/tvbox_config/ # 源代码包
│ ├── __init__.py # 公开 API
│ ├── app.py # 主程序入口
│ ├── _check.py # `uv run check` 入口
│ ├── decrypt.py # AES-CBC / base64 解密
│ ├── http_client.py # HTTP 客户端 (httpx)
│ ├── json_builder.py # JSON 输出生成
│ ├── logger.py # 日志模块
│ ├── models.py # 数据模型
│ └── source_manager.py # YAML 配置管理
├── tests/ # 测试
├── pyproject.toml
├── uv.lock
└── AGENTS.md # opencode 项目指引
# 安装依赖
uv sync
# 运行程序
uv run tvbox-config
# 跑测试
uv run pytest# 一键检查(lint + format + type check)
uv run check
# 或分别执行
uv run ruff check src/tvbox_config/
uv run ruff format src/tvbox_config/
uv run ty check src/tvbox_config项目配置了 GitHub Actions,每天 03:00 UTC(11:00 北京时间)自动检测并更新可用的 TVBox 线路。
编辑 config/sources.yaml 添加或修改数据源:
sources:
- name: "源名称"
urls:
- "https://example.com/1.json"
- "https://example.com/2.json"
encrypted: false # 是否为加密源
r18: false # 是否为 R18 源name: 数据源名称urls: URL 列表(按顺序检查,第一个可用的将被使用)encrypted: 是否为加密源(优先本地 Python 解密,失败后回退到解密 API)r18: 是否为 R18 源(R18 源只会出现在 my.json 中)