dysub
本地优先的字幕提取工具 — 音视频 → 字幕,全程本地处理。
简介
DySub 是一款完全运行在用户本地的开源字幕提取工具。支持本地音视频文件和抖音分享链接作为输入,在本地完成音频提取、标准化与转写,最终调用用户自备的 ASR API,生成 SRT / VTT / TXT 字幕文件。
🔒 核心原则:所有数据处理均在用户本地完成。开发者不托管任何在线服务,不接触用户的音视频内容,也不经手用户的 API Key。
安装
pip install dysub
前置依赖:
- Python 3.10+
- FFmpeg
快速开始
1. 配置 API Key
推荐阿里百炼(DashScope):
- 打开 阿里百炼控制台
- 进入「API Key 管理」→ 创建新的 API Key
- 写入配置:
mkdir -p ~/.config/dysub
cat > ~/.config/dysub/.env << 'EOF'
DYSUB_ASR_API_KEY=sk-xxxxxxxx
DYSUB_ASR_BASE_URL=https://dashscope.aliyuncs.com/api/v1
DYSUB_DEFAULT_LANGUAGE=zh
DYSUB_DEFAULT_FORMAT=srt
EOF
2. 提取字幕
# 本地视频
dysub process ./video.mp4 --lang zh
# 抖音链接
dysub process "https://v.douyin.com/xxxxx" --lang zh
# 启动 WebUI
dysub webui
# 浏览器访问 http://127.0.0.1:7860
字幕默认输出到 outputs/ 目录。
包含的组件
安装 dysub 会自动安装以下包:
| 包名 | 说明 |
|---|---|
dysub-core |
核心引擎:音频处理、ASR 客户端、字幕合并、CLI |
dysub-input-local |
本地文件输入插件(MP4/MP3/MKV 等) |
dysub-input-douyin |
抖音链接解析插件 |
更多文档
Metadata
Release files for dysub 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dysub-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for dysub-0.1.1-py3-none-any.whl |
Release files / dysub-0.1.1-py3-none-any.whl
| Download URL | dysub-0.1.1-py3-none-any.whl |
|---|---|
| Size | 2.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f8111404e0607c9b5796aa95d87e8b4d241d7cbf0a360c2013aa38a70b6c543
|
|
BLAKE2b-256 checksum How to use checksums |
5aa486de1865e03df941b2a0363e3f67f955ab1db749e5bfc1691a96cbbdba96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for dysub 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.