Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flyingfathead/srt-translate-openai-api
Configurable Python-based .srt subtitle translator for OpenAI API
https://github.com/flyingfathead/srt-translate-openai-api
openai openai-api openai-api-python python python3 srt srt-subtitles translate translate-api translator
Last synced: 16 days ago
JSON representation
Configurable Python-based .srt subtitle translator for OpenAI API
- Host: GitHub
- URL: https://github.com/flyingfathead/srt-translate-openai-api
- Owner: FlyingFathead
- Created: 2024-03-25T12:52:07.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-06T14:16:45.000Z (7 months ago)
- Last Synced: 2025-01-06T21:40:12.788Z (20 days ago)
- Topics: openai, openai-api, openai-api-python, python, python3, srt, srt-subtitles, translate, translate-api, translator
- Language: Python
- Homepage: https://github.com/FlyingFathead/srt-translate-OpenAI-API
- Size: 60.5 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# srt-translate-OpenAI-API
Configurable Python-based .srt subtitle translator utilizing the OpenAI API.## Install
To use this script, you first need to clone the repository and install the required Python dependencies.
```bash
git clone https://github.com/FlyingFathead/srt-translate-OpenAI-API.git
cd srt-translate-OpenAI-API
pip install -r requirements.txt
```## Usage
After installing the necessary dependencies, you can run the script using:
```bash
python translate_srt.py path/to/your/file.srt
```Make sure to replace `path/to/your/file.srt` with the actual path to your subtitle file.
## Configuration
Before running the script, you need to set up your OpenAI API key. You can do this by setting an environment variable `OPENAI_API_KEY` or by placing it in a file named `api_token.txt` in the same directory as the script.
## Changes
- v0.11.1 - added utilities inside `utils/` for shorthanding (for NLP processing) and de-shorthanding
- v0.11 - option to split long lines in output
- v0.10 - avoid file collisions w/ output file
- v0.09 - clarity for term preview
- v0.08 - preview printout during translation
- v0.07 - unique block marker
- v0.06 - block counting
- v0.05 - additional error handling
- v0.04 - option to add in additional information for the model
- v0.03 - initial commit## About
By [FlyingFathead](https://github.com/FlyingFathead) (w/ digital ghost code from ChaosWhisperer)