Metadata-Version: 2.1
Name: gpttsrt
Version: 0.0.2
Summary: Gpt powered subtitle translation tool.
Home-page: https://github.com/Seeker0472/gpttsrt
Author: Seeker472
Author-email: gmx472@qq.com
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pysrt~=1.1.2
Requires-Dist: requests
Requires-Dist: tqdm~=4.65.0
Requires-Dist: configargparse~=1.4
Requires-Dist: openai~=1.9.0

# gpttsrt

一个使用gpt3.5来批量翻译srt字幕文件的工具,用来批量翻译公开课字幕

名字: gpt_translate_srt -> gpttsrt

## 使用方法说明

### PYPI 安装(推荐)

```bash
pip install gpttsrt
```

### 源码安装
    
clone 本项目到本地
```bash
git clone https://github.com/Seeker0472/gpttsrt.git
```
cd到项目目录
```bash
cd gpttsrt
```
安装
```bash
pip install -e .
```
## 配置文件
**example:** gpttsrt.conf
```conf
path_in = './input' # 输入文件夹
path_completed = './completed' # 将翻译完成的源文件移动到这个文件夹
path_out = './output' # 输出文件夹
api_key = '' # openai的api key
mirror_url= '' # openai的api url,如果不适用镜像服务就不用填
max_thread = 10 # 最大线程数(同时翻译多个文件,提高速度), 默认为10
line_per_request = 10 # 每次请求翻译的行数, 默认为10
```
## 运行
```bash
gpttsrt -c --config gpttsrt.conf
```

## TODO
- [x] 多线程优化翻译速度
- [x] 优化翻译结果,检测翻译结果是否异常
- [ ] 优化翻译结果,使用gpt给长句断句
- [ ] 优化翻译结果,使用使用whisper模型给断句后的句子标记时间
