Show Subtitle/Audio Names and Media Version Info for Plex

Update 2: This has been implemented by Plex in the latest Plex Web!

This script allows you to see the subtitle, video, and audio track names embedded in media files within the Plex Web app and Plex Media Player.

Update: It now also shows the file format and codec when you click “Play Version” for multiple file versions. (Excludes optimized versions which already have titles.)

GitHub: https://github.com/iwalton3/media-scripts/tree/master/inject-titles-for-plex

Plex Web

  1. To use the tweak with Plex Web, install Greasemonkey (Firefox) or Tampermonkey (Chrome).
  2. Then install the User Script.

Plex Media Player

  1. Find the install folder for Plex Media Player web client.
    • Windows: C:\Program Files\Plex\Plex Media Player\web-client\desktop\js
    • Linux: /usr/local/share/plexmediaplayer/web-client/desktop/js/
    • OSX: /Applications/Plex Media Player.app/Contents/Resources/web-client/desktop/js
  2. Download the tweak file.
  3. Append the file to the newest JS bundle named chunk-2-[hash]-plex-[version].js.

Plex Media Player (TV Mode)

  1. Find the install folder for Plex Media Player web client.
    • Windows: C:\Program Files\Plex\Plex Media Player\web-client\tv
    • Linux: /usr/local/share/plexmediaplayer/web-client/tv
    • OSX: /Applications/Plex Media Player.app/Contents/Resources/web-client/tv
  2. Download the tweak file.
  3. Add the contents of the tweak to index.html after window.performance.measure('init:js:eval', 'init:js:eval:start');.

Plex Desktop

  1. Find the install folder for Plex Media Player web client.
    • Windows: C:\Program Files\Plex\Plex\web-client\js
  2. Download the tweak file.
  3. Append the file to the newest JS bundle named chunk-1-[hash]-plex-[version].js.

Plex for Kodi

Please see the instructions here: https://github.com/iwalton3/media-scripts/tree/master/inject-titles-for-plex/kodi

Screenshots

Subtitle and audio track names are now shown.
image
The codec, bit depth (if not 8), and container format are shown in the version selection dialog.
image

Filename Version

If you prefer that the media version selection shows the filename of the media version instead of the codec and file format, you can use this version. The dialog can get a bit crowded if you have long filenames though. (This also includes the subtitle/audio name tweak. Do not install both.)

image

This version will only include what is inside { } (or Unknown if there aren’t any):

Please note that this script may break in future versions of Plex. It shouldn’t though, as the Plex API that it intercepts and modifies seems to be relatively stable. Please let me know if you have problems.

Other Players or Entire Plex Server

If you’re interested in having these changes affect all the clients for an entire server, including ones that are not compatible with this script, you should check out Metaproxy. This is a proxy server that implements a similar function to the scripts here.

11 Likes

Neat, if only Plex would ever get around to addressing this for everyone instead of leaving it up to users to hack together a solution.

I’ll be installing it for when I use PMP and/or Web

1 Like

I did a batch file so it’s easier to do in Windows. Enjoy!

Edit: I screwed a line when putting it together. For everyone that tested it and didn’t get it to work, you can try now. An user named Baine fixed it and now his commit has been merged into the main branch.

2 Likes

This is great, thank you man! I can confirm it works for PMP on Mac too. Found at:

/Applications/Plex Media Player.app/Contents/Resources/web-client/desktop/js

Thanks again, now I can finally see which of my fancy anime subtitles are which! <3

1 Like

I could kiss you…This has been one of my biggest gripes with Plex.

Now all I need is for Plex to auto-play specials when they’re supposed to be played and the program will be literal perfection for me.

Hats off to you good sir!

Works great!

Good job!

If only this would work on Android TV.

@iwalton3
Thanks for that. Here is a path for those that use Plex Media Player on OpenElec:
/usr/share/plexmediaplayer/web-client/desktop/js/

One question though. For those of us that does not speak english as a first language, or those of us that have a hard time understanding certain words, would you mind explaining what you mean by “append”? Should I add an include line in the js file inside that folder and reference your js file? Or do you mean something else? Mind explaining exactly what to do?

Also, I see several chunks. All the way up to 5. Should I still choose number 2?

Copy-paste all of the lines from the JS file I posted into the “chunk” file. The file numbered as 2 is the one that I found was referenced by the index.html. You can check to be sure.

Thanks. For some reason I am not allowed to edit that file even though I am logged in with root user. Need to figure that out somehow.

EDIT: Apparently the embedded version has a root filesystem which is a (compressed) squashfs file system and therefore must be readonly. Even root cannot modify any files there. Dang it!

Yes you are correct in that root cannot modify the filesystem. You have two options. The first is to copy the entire directory to the one where settings is stored, modify it, and add a startup script that does a mount -t bind /path/to/files /usr/share/plexmediaplayer/web-client/desktop/js. The second is to use unsquashfs to extract the image, perform the change, and then use mksquashfs to compress it again. You need to do the second option using another computer.

Brilliant, now if you could get the plex team to integrate this since it’s not that difficult to display.

1 Like

Am I right to assume you can’t make this work from the media server side so it applies to all players? That would be amazeballs!

Technically something like this is possible, but you’d have to write a proxy server to intercept all of the API requests. This means intercepting HTTPS and also taking a performance hit. It might also mess up the port forwarding and server discovery.

Yeah Plex really needs to address this. Give users the ability to “name/designate” versions to different files. Right now, the only identifier in the “Play Versions” is bit rate and resolution, which is awfully insufficient nowadays.

Nice mod, I set up a replace filter on my reverse proxy (Caddy) to add the .js file right before the chunk. This way it will persist through updates. I was already using this method to load a .css file.

filter rule {
path “/”
search_pattern “<script src=”/web/js/chunk"
replacement “<script src=“https://website.com/inject-titles.js”><script src=”/web/js/chunk"
}
This method could work for NGnix as well.

About the tweak file made to show the filename for different versions, would it be possible to limit it to showing the characters in between, let’s say {} for example? So instead of “Big Buck Bunny {Director’s cut}” it shows “Director’s cut”.

Thank you!

This version will only include what is inside { } (or Unknown if there aren’t any):

1 Like

Wow, that was fast. Thank you so much!

Not sure what I’m doing wrong, but I cannot get any of these solutions to work. I copy and pasted the inject file into the end of my chunk2 file using notepad. Perhaps notepad is my error, but when I use the inject.bat command, I get the same result.

In any case, neither seems to have any effect on my plex server or player…they still show the “English (ACC)” for every audio track. My video is in Quicktime (.mov) format as that is the only file format in Adobe Premiere cc 2020 that allows export of multiple audio tracks.

Any suggestions?