This is an example implementation for translating .srt files using the ChatGPT API.
-
If you don’t have Python installed, install it from here.
-
Clone this repository.
-
Install the requirements:
$ pip install openai $ pip install asyncio
-
Define your API key.
$ export OPENAI_API_KEY=...
-
Define your language.
$ export TARGET_LANGUAGE="Korean"
-
Obtain the source subtitles and save it as
input.srt
. -
Run the app:
$ python run.py
-
The translated subtitle file is generated as
output.srt
.