Edit: This code is working and completed. Thanks to all who helped! Feel free to use this code for your own purposes. I will be running this code periodically on my home server to set preferred subtitles. Cheers!
This code was created with the help of ChatGPT Open AI and further edited and completed by me. It uses Plex Python Api. It will set all movies and shows in your local Plex library to English non forced subtitles by default. The subtitle selections will apply to your Plex profile and be remembered on other devices. Assuming your Plex subtitles settings are setup in your server settings Plex will default to Forced Subtitles by default when they are available for a given item. Plex will not allow you to prefer non forced subtitles natively hence why this script was created.
See answer below for the code.
Also posted on:
Python code: