一个 macOS 上的 B 站番剧弹幕导出工具:搜索番剧、读取分集、批量导出 .ass 字幕。
- macOS 15+
- Xcode 16+
- Python 3(建议 3.9+)
安装 Python 依赖(在项目目录执行)
pip3 install -r Bcrawler/Scripts/requirements.txt
search.py:关键词搜索番剧fetch_episodes.py:根据season_id拉取分集fetch_danmaku.py:根据cid下载 XML 并转换为.ass- Swift 通过
PythonBridge调 Python,stdout JSON 回传进度和结果
- 在终端验证:
which python3 - 在 App 设置页把 Python 路径改成终端输出的绝对路径(例如
/opt/homebrew/bin/python3) - 再验证:
python3 --version
- 重新安装依赖:
pip3 install -r Bcrawler/Scripts/requirements.txt --upgrade - 直接测试脚本:
python3 Bcrawler/Scripts/search.py --keyword "进击的巨人"
- 检查
Scripts是否真的在Copy Bundle Resources - 确认是“文件夹引用”(蓝色文件夹)而不是普通分组
- 清理后重编译:
Shift + Command + K再⌘R
- 检查代理/VPN 是否拦截 B 站接口
- 在浏览器直接访问:
https://comment.bilibili.com/{cid}.xml
- 在 Xcode 的
Signing & Capabilities中检查:- Network Outgoing Connections
- 用户选择目录读写权限
Bcrawler/
├── BcrawlerApp/ # App 入口与全局状态
├── Models/ # 数据模型
├── ViewModels/ # 业务逻辑
├── Views/ # 界面
├── Services/ # PythonBridge
└── Scripts/ # Python 脚本