Cerlancism / chatgpt-subtitle-translator

Efficient translation tool based on ChatGPT API
https://cerlancism.github.io/chatgpt-subtitle-translator/
MIT License
143 stars 16 forks source link

Number of lines #4

Open juvesito opened 11 months ago

juvesito commented 11 months ago

I tried it, and it works nicely. Good job! I have an issue or maybe it's more of a feature request... Is it possible to use the two lines of the subtitles? I tried using SRT format with two lines, but the output is only in one line.

When a subtitle has more than 37 characters, it's recommended to split it into two lines. I tested this in ChatGPT, and it worked well, but it's not automated.

Thanks!

Cerlancism commented 11 months ago

It is intended as of now to combine multiple lines of a single SRT timestamp entry as 1. Will be looking into better ways doing this further. Would try the new function call format feature or TypeChat.

juvesito commented 11 months ago

I sugest, giving the full format to chatGPT and explain in the prompt that you want. And also you can send like 10 subs in every interaction, this will help chatgpt to understand better the context...

Translate the subtitle text into desiredlanguaje, but keep the subtitle number and timecode line unchanged: \n{text}",

juvesito commented 11 months ago

I tried directly in the ChatGPT web client and got good results. Then I found this project that aligns with my idea... https://github.com/jesselau76/srt-gpt-translator

Finally, I implemented a mix of this code and a watchdog to manage the input files and execute the script with parameters depending on the file location (for example, input_eng, input_fra, input_ita, etc).