Modify variants in m3u8 playlist before sending to client

Hi,

 

I've created a Plex Channel for Youtube HLS Live Streams and it works fine, however due to my ISPs routing streams sometimes stay at the lowest quality (which is unbearable on a 480p+ device) for a long time before switching. I'm currently just sending the url to the 1080p playlist to the client, but I'd like to instead send just 720p and 1080p streams.

 

If i create multiple PartObjects with the different resolutions the client will just choose the highest or whichever is chosen in the client settings, this is not what I want.

 

The only other option I can think of is hosting a dynamic script (say php) on a separate web server to create a new m3u8 file (with session id etc)

 

TL;DR: Can Plex "host" a m3u8 file with the acceptable resolutions *dynamically* somehow?

You can download the m3u8 playlist file, do whatever you want with the content and create a new playlist file and hand this over to the client. An example of a URL Service that makes changes to a m3u8 file is the Team Coco one: https://github.com/plexinc-plugins/Services.bundle/blob/master/Contents/Service%20Sets/com.plexapp.plugins.teamcoco/URL/Team%20Coco/ServiceCode.pys#L90-L124