Skip to content

这个实时字幕翻译插件将OpenAI的ChatGPT API(或任何具有相同API调用方法的模型)集成到PotPlayer中。它使你在观看视频时能够实时翻译字幕,从而打破语言障碍,提升你的观看体验。 This real-time subtitle translation plugin integrates OpenAI's ChatGPT API (or any model with the same API calling method) into PotPlayer. It enables you to translate subtitles on-the-fly while watching videos.

License

Notifications You must be signed in to change notification settings

Felix3322/PotPlayer_ChatGPT_Translate

Repository files navigation

Forks Stargazers Issues License

PotPlayer_ChatGPT_Translate 🚀

A PotPlayer plugin that leverages the ChatGPT API to provide real-time, context-aware subtitle translation. ✨

It works on my machine

Works on my machine.

🐞 Report Bug  ·  💡 Request Feature


About The Project 💬

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.

This plugin is also compatible with any AI model that follows the same API call format as ChatGPT.

🔍 Google Translate vs ChatGPT Translate

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:

    "你要老了我他妈的宇宙吗?"

    (Nonsensical and incorrect)

  • ChatGPT Translation Result:

    "你要像《老黄犬》一样对待我的宇宙?"

    (Correctly captures the reference and intended meaning)

🧐 ChatGPT Without Context vs. ChatGPT With Context Comparison

  • 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)

(back to top)


Video Tutorial 🎥

Click below to watch the tutorial on Bilibili:

Watch on Bilibili

(back to top)


Built With 🛠

  • AngleScript – The scripting language used to develop the plugin
  • ChatGPT API – Provides context-aware translation capabilities
  • PotPlayer API – Enables seamless integration with PotPlayer

(back to top)


Installation 📦

Fully Automatic Installation (Recommended) ⚡

  1. Download the Installer:
    Installer
    (The installer is open source, so you can review the source code)
  2. Run the Installer:
    • Double-click installer.exe to start the installation.
    • The installer automatically detects your PotPlayer installation path and completes the setup.

Manual Installation 🔧

  1. Download the ZIP File:
    Download the latest ZIP file from this repository.
  2. Extract the ZIP File:
    Extract the contents to a temporary folder.
  3. Copy Files:
    Copy ChatGPTSubtitleTranslate.as and ChatGPTSubtitleTranslate.ico to the following directory:
    C:\Program Files\DAUM\PotPlayer\Extension\Subtitle\Translate
    
    Replace C:\Program Files\DAUM\PotPlayer with your custom PotPlayer installation path if necessary.

(back to top)


Sure! Here's the updated README section, with your extended model API list included in English and following the current structure:


Configuration ⚙️

  1. Open PotPlayer's Preferences:
    Press F5 to open the PotPlayer Preferences.

  2. Navigate to Extensions:
    Go to Extensions > Subtitle translation.

  3. Select the Translation Plugin:
    Choose ChatGPT Translate as the translation plugin.

  4. 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 using the following format:

      ModelName|API Base URL
      

      Example:

      gpt-4o-mini|https://api.openai.com/v1/chat/completions
      

      Note:
      In version v1.5 and later, if you're using a self-hosted or third-party API that does not require an API key, you can add nullkey at the end:

      gpt-4o-mini|nullkey
      

      or:

      qwen2.5:7b|https://127.0.0.1:11434/v1/chat/completions|nullkey
      
    • API Key:
      Enter your API key if needed.

      You can test your API key using keytest.obanarchy.org to ensure it is valid.

  5. Set the Source and Target Languages:
    Configure the source and target languages as required.


Available Models (Examples)

Use the format:

ModelName|API Base URL|nullkey (optional)

Here is a list of supported models:

Deepseek: deepseek-chat|https://api.deepseek.com/v1/chat/completions
Tongyi Qianwen: qwen-plus|https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions
SiliconFlow: siliconflow-chat|https://api.siliconflow.cn/v1/chat/completions
ERNIE Bot (Wenxin Yiyan): ernie-4.0-turbo-8k|https://qianfan.baidubce.com/v2/chat/completions
Gemini: gemini-2.0-flash|https://generativelanguage.googleapis.com/v1beta/openai/chat/completions
ChatGLM: chatglm-6b|https://api.chatglm.cn/v1/chat/completions
LLaMA: llama-13b|https://api.llama.ai/v1/chat/completions
Code LLaMA: code-llama-34b|https://api.llama.ai/v1/code/completions
DeepSeek-V3: deepseek-v3|https://api.deepseek.com/v3/chat/completions
DeepSeek-R1: deepseek-r1|https://api.deepseek.com/r1/chat/completions
Local Deployment (no API key): model-name|127.0.0.1:PORT|nullkey

You can expand or replace these with any OpenAI-compatible model that supports the chat/completions endpoint.

(back to top)


Usage ▶️

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.

(back to top)


Roadmap 🗺

  • 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.

(back to top)


Contributing 🤝

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.

(back to top)


License 📄

Distributed under the MIT License. See LICENSE for more information.

(back to top)


Contact 📞

Personal website: obanarchy.org

(back to top)


Acknowledgments 🙏

  • 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).

(back to top)


Star History

Star History Chart


好久没更新了?

憋个大的awa

About

这个实时字幕翻译插件将OpenAI的ChatGPT API(或任何具有相同API调用方法的模型)集成到PotPlayer中。它使你在观看视频时能够实时翻译字幕,从而打破语言障碍,提升你的观看体验。 This real-time subtitle translation plugin integrates OpenAI's ChatGPT API (or any model with the same API calling method) into PotPlayer. It enables you to translate subtitles on-the-fly while watching videos.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published