Plex-scripts
Plex-scripts copied to clipboard
Audio_sub_changer: More control over the selection of the track, looking at the "version" of the stream
In what file should the feature be added? audio_sub_changer.py
What is the feature request? I'd like to auto select English subtitles, where available, rather than English Forced (which are often auto selected by Plex). Please could you add the functionality to discriminate (and prefer) between Forced and non-Forced subtitles.
Just to add a different use case, e.g. anime series may have multiple versions of English subtitles. It would be nice to somehow set a specific subtitle track to be used for the whole series.
Just to add a different use case, e.g. anime series may have multiple versions of English subtitles. It would be nice to somehow set a specific subtitle track to be used for the whole series.
@Mushin how do these multiple English subtitles differentiate from each other? For example, your original request was "I want the script to select non-forced above forced". That's very clear. Formulate such "rule" but then for these anime versions too. E.g. "give preference if the subtitle has a certain name". Or "give preference if the subtitle is longer". Make a clear rule that I can make in the script.
@Casvt thanks for the guidance - I hope I haven't over complicated this. See below for an example of 2x subtitle track info from Plex - in this case, it seems the discriminating field would be Title
Alright that's clear. Thank you
Request completed. See the documentation and examples inside the file to learn how to use the new arguments. The script has had a major face lift with many new features added, speed improvements and has even replaced a whole script (auto_audiochannels.py is now integrated into this script).
The user can now make the script decide the best stream to select based on (all optional except language):
- language (e.g.
en
-> english) - forced status (
avoid
orprefer
) - codec (e.g.
ass
) - title (e.g. title contains
songs
) - channel count (audio only; e.g.
6
-> prefer 5.1 audio streams)
You can even give "preference orders" now via the arguments. That means that you can give a selector multiple times like this:
--Language en --Language nl --Language it
This way, English streams are preferred, but if there are none available, then choose Dutch and if that's not available choose Italian, etc. etc. This is available for languages and codecs.
Enjoy!