blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.67k stars 307 forks source link

[Feature Request] Device Kill #320

Closed dgriffinzero closed 2 years ago

dgriffinzero commented 2 years ago

Is your feature request an improvement on an existing script? Please link to script. https://github.com/blacktwin/JBOPS/blob/master/killstream/kill_stream.py

To be able to terminate streams based on "machine_id" or "player" attribute.

Is your feature request related to a problem? Please describe. This would allow me to terminate streams from specific users on a shared account automatically. Yes, I know this is usually handled at the account level, but there are uniquely idiotic circumstances.

Describe alternatives you've considered Replacing all references in the existing script outside of those required as part of the get_all_streams function (and a few others I skimmed over) for the parameter user_id with the parameter machine_id.

Additional context None.

blacktwin commented 2 years ago

{device} and {player} parameters exist in Tautulli. Use those parameters in your Conditions to isolate the player or device you want to target. Tautulli drives this script.

dgriffinzero commented 2 years ago

Thank you for your response, and I hate to admit it, but I had things backwards in my head.

However, I chose to continue to work with {machine_id} because it allows for the best precision in targeting of specific devices versus the {device} or {player}.

If you target {device} with no other conditions, Tautulli will fire off this script for every device that meets that description. Ergo: ( {device} = 'Chromecast' ) will cause every Chromecast to get blocked.

If you target {player}, all the user has to do to get around the matching is change the name of their device from the settings on the Plex app.

However, if you target {machine_id}, it looks like the user has to uninstall and reinstall the Plex client from their device in order to generate a new {machine_id} attribute. More testing required, but that's the behavior I've seen so far with Windows and Android clients.