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

发行版中的蓝奏云镜像不可用。作者在海外,蓝奏云上传速度非常慢,每次都超时。望国内大佬代上传,可通过issue或obanarchy.org提供的联系方式联系到我。


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)


Configuration ⚙️

  1. Open PotPlayer's Preferences (press F5).
  2. Navigate to Extensions > Subtitle translation.
  3. Select 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 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.

  5. Set the source and target languages as required.

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


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