Skip to content

enhancement(plex): support internal subtitles#809

Merged
killergerbah merged 1 commit intokillergerbah:mainfrom
ShanaryS:plex-internal-subtitles
Oct 24, 2025
Merged

enhancement(plex): support internal subtitles#809
killergerbah merged 1 commit intokillergerbah:mainfrom
ShanaryS:plex-internal-subtitles

Conversation

@ShanaryS
Copy link
Copy Markdown
Collaborator

@ShanaryS ShanaryS commented Oct 23, 2025

fixes #580

This is a follow to my PR last year #533 which added external subtitle support to Plex. Plex finally added documentation to their api last month. This made it much easier to tackle this problem though I probably gave up too early last time.

The roadblock from before was that while I had the right endpoint, I needed the right arguments to have Plex deliver the entire subtitle. Now with the docs and a lot of testing, I was able to get this working along with a few other improvements.

  • Can now transcode the entirety of a media's internal subtitles, works with no changes to the app. The big downside is it takes a long time, anywhere from 15s to a few minutes depending on the media. This is mitigated by setting Plex to the lowest video quality before choosing to load the sub in asbplayer.
  • Will check for image subtitles or if Plex is burning the subtitles and raise an appropriate error with instructions.
  • Updated the basename to Show SXXEYY · Episode Title instead of just Episode Title, movies are now Title · Year instead of Title.
  • Subtitle labels now contain more relevant information when available, e.g Chinese · Mandarin / Traditional (SRT External) instead of Chinese (SRT External).
  • Handle multiple versions of a media existing (relevant for internal subs) for proper drop down selection.
  • Use the 3 letter language code for language instead of name (2 letter codes also available).

This generally works well but it can fail if there is too much going on. Plex has to transcode the media for this which I assume has some internal limits. This generally should not be a problem unless the user keeps interrupting the transcodes.

One thing I would like to see that's kinda out of scope for this PR is some indication that the subtitle is loading, specifically being fetched. Since it can take a few minutes for Plex to extract the subtitles, it leaves for a poor UX since the dialog closes immediately. I think a spinner replacing the OK button and keeping the dialog up until it's fully loaded would go a long way. This is especially painful if the user has auto load on for the the subtitles.

@ShanaryS ShanaryS force-pushed the plex-internal-subtitles branch 3 times, most recently from e1884b6 to 79a5348 Compare October 24, 2025 16:59
@ShanaryS ShanaryS force-pushed the plex-internal-subtitles branch from 79a5348 to 616dcd1 Compare October 24, 2025 18:13
@killergerbah
Copy link
Copy Markdown
Owner

killergerbah commented Oct 24, 2025

Hey @ShanaryS thanks for this. It looks like really meticulous work. I tested it out and looks like it's working.
Just some general comments:

  • As you've probably already thought about, it would be nice if we could get the internal subtitle track list without having to select it in Plex first. When I selected it in Plex I had to wait a minute or so, then when I selected it in asbplayer I had to wait another minute.
  • asbplayer actually supports pgs subtitles. Not sure if it's possible to just download the pgs file in that case.

@killergerbah killergerbah added this to the Extension v1.13.0 milestone Oct 24, 2025
@killergerbah killergerbah merged commit c3ccbf2 into killergerbah:main Oct 24, 2025
1 check passed
@ShanaryS
Copy link
Copy Markdown
Collaborator Author

ShanaryS commented Oct 25, 2025

@killergerbah Thanks for the quick merge!

As you've probably already thought about, it would be nice if we could get the internal subtitle track list without having to select it in Plex first.

There is no way around this unfortunately. Plex doesn't allow us to choose what internal subtitle gets transcoded, we just tell it which playback session to transcode for so the user has to select it. The information for all the subtitles and everything we could need is in the responses or even more endpoints. But even if we were to display all the internal subtitles, it's an illusion of choice as they all would transcode the one selected in the Plex player so I opted not to show them.

When I selected it in Plex I had to wait a minute or so, then when I selected it in asbplayer I had to wait another minute.

You can select it before hitting play. It also can default to a specific language from the settings in your account.

asbplayer actually supports pgs subtitles. Not sure if it's possible to just download the pgs file in that case.

Plex always burns in image formats which means this command would fail (it actually just hangs indefinitely). The only way to get the internal subtitles is for Plex to transcode them for which they have a lot of baked in logic for.

If I find anything else I'll be sure to add it, but these are the limitations we have the work with for now.

@ShanaryS ShanaryS deleted the plex-internal-subtitles branch October 25, 2025 00:56
@killergerbah
Copy link
Copy Markdown
Owner

Got it, thanks for the explanations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plex automatic subtitle detection support?

2 participants