A PotPlayer plugin that leverages the ChatGPT API to provide real-time, context-aware subtitle translation. ✨
Works on my machine.
发行版中的蓝奏云镜像不可用。作者在海外,蓝奏云上传速度非常慢,每次都超时。望国内大佬代上传,可通过issue或obanarchy.org提供的联系方式联系到我。
PotPlayer_ChatGPT_Translate is a PotPlayer plugin that integrates the ChatGPT API to deliver real-time, context-aware subtitle translation. Unlike traditional translation tools, this plugin considers context, idioms, and cultural nuances to produce more accurate translations. The core of the project is implemented using AngleScript, leveraging both the ChatGPT API and PotPlayer API for deep integration.
One key advantage of using ChatGPT for subtitle translation is its ability to understand context and cultural references. Compare the following results:
-
Original subtitle:
"You're gonna old yeller my f**king universe."
-
Google Translate Result:
-
ChatGPT Translation Result:
"你要像《老黄犬》一样对待我的宇宙?"
(Correctly captures the reference and intended meaning)
-
Original Subtitle:
"But being one in real life is even better."
-
ChatGPT Translation (Without Context):
"但是,在现实生活中成为一个人甚至更好。"
(Literal translation, failing to capture the implied meaning) -
ChatGPT Translation (With Context):
"但在现实生活中成为一个反派更好。"
(Accurately capturing the intended context)
Click below to watch the tutorial on Bilibili:
- AngleScript – The scripting language used to develop the plugin
- ChatGPT API – Provides context-aware translation capabilities
- PotPlayer API – Enables seamless integration with PotPlayer
- Download the Installer:
Installer
(The installer is open source, so you can review the source code) - Run the Installer:
- Double-click
installer.exe
to start the installation. - The installer automatically detects your PotPlayer installation path and completes the setup.
- Double-click
- Download the ZIP File:
Download the latest ZIP file from this repository. - Extract the ZIP File:
Extract the contents to a temporary folder. - Copy Files:
CopyChatGPTSubtitleTranslate.as
andChatGPTSubtitleTranslate.ico
to the following directory:ReplaceC:\Program Files\DAUM\PotPlayer\Extension\Subtitle\Translate
C:\Program Files\DAUM\PotPlayer
with your custom PotPlayer installation path if necessary.
- Open PotPlayer's Preferences (press F5).
- Navigate to Extensions > Subtitle translation.
- Select ChatGPT Translate as the translation plugin.
- Configure the plugin:
-
Model Name:
You can simply enter the model name, which will use the default API URL.
Example:gpt-4o-mini
Alternatively, specify a custom API URL in the format:
Model Name|API Interface URL
Example:gpt-4o-mini|https://api.openai.com/v1/chat/completions
-
API Key: Enter your API key.
You can test your API Key using keytest.obanarchy.org to ensure it is valid.
-
- Set the source and target languages as required.
When playing a video with subtitles in PotPlayer, the plugin automatically calls the ChatGPT API to translate the subtitles in real time. By handling context, idioms, and cultural nuances, the plugin provides more accurate translations.
For example:
- Input: "You're gonna old yeller my f**king universe."
- Traditional Translation Tools might output a literal or awkward translation.
- ChatGPT Translation captures the movie reference and context to deliver a more appropriate translation.
- Integrate ChatGPT API with PotPlayer API for real-time subtitle translation.
- Support additional AI models (planned for the future, not imminent).
- Optimize context handling to further improve translation accuracy.
Contributions are welcome! When submitting a pull request, please clearly describe the purpose of your changes.
If you have suggestions for improvements or bug fixes, feel free to open an issue before making modifications.
Distributed under the MIT License. See LICENSE
for more information.
Personal website: obanarchy.org
- Thanks to OpenAI for providing the powerful ChatGPT API.
- Thanks to the PotPlayer team for creating an excellent media player.
- Thanks to everyone who has contributed suggestions or code to improve this project (contributor details will be updated here).