JBOPS - Just a Bunch Of Plex Scripts

I’m trying to use tautulli + JBOPS kill_stream script to kill HEVC transcoding. I’ve set the conditions to:
‘Stream Video Codec’ + ‘contains’ + ‘HEVC’ or ‘HEVC 4k’ or ‘h265’.

But i keep getting the following message in the logs:
‘Tautulli NotificationHandler :: Custom condition evaluated to ‘False’. Conditions: [False].’

Does anyone know if it is possible to apply such condition ?

Thanks

Any parameter staying with “Stream” is the after transcoding value. You want “Video Codec” for the pre-transcoding value.

Video Codec (HEVC) -> Stream Video Codec (H264)

If you to see all the values for a particular stream, click on the word STREAM on the activity card on the homepage.

1 Like

Yes, it works that way. Thanks.

Do you know any trigger that happens when the user changes quality while stream has already started ? If trigger is only at playback start, then user can start at full quality and reduce the quality afterwards so he won’t get the stream killed.

I’m 90% sure that counts as the start of a new play, at the least, it’s a stream resumed.

@Blacktwin is there a why to combine Tautulli and the kill script in such a why that if certain users play content they are not suppose to (like someone young playing rated R movies) that the stream is killed?

I know I can limit users to be able to only view certain content ratings but that removes a bunch of content from their view which they should be able to view, so thought I would allow access to entire library and just kill streams based on the above if possible. Thanks.

You can use custom conditions in the notifier to achieve this. Here is a wiki article explaining custom conditions.

https://github.com/Tautulli/Tautulli-Wiki/wiki/Custom-Notification-Conditions

1 Like

I am trying to use the notify_newip.py and have it set as follows:

script notification in Tautulli with playback start as the trigger and specifying the script
within the script i use a notification id of 1

When I try and test this, I get the following error in the log:

Tautulli Notifiers :: Script exceeded timeout limit of 30 seconds. Script killed.

Just wanted to check and see if anyone has used this script and if they had to increase the script timeout?

60 secs seems to work for me. Just need to figure out this message:

Tautulli Notifiers :: Script returned:
No IP address passed from Tautulli.

Do I need to pass any of these arguments to the notification agent?

Arguments passed from Tautulli
-sn {show_name} -ena {episode_name} -ssn {season_num00} -enu {episode_num00} -srv {server_name} -med {media_type}
-pos {poster_url} -tt {title} -sum {summary} -lbn {library_name} -ip {ip_address} -us {user} -uid {user_id}
-pf {platform} -pl {player} -da {datestamp} -ti {timestamp}

Test button can not pass information as would be used during live streaming from server.

Absolutely - the script has to have that information to act on/fill in the rest of the notification script. It would appear you can copy/paste the entire block of those parameters into Tautulli’s ‘script arguments’ line.

1 Like

For the notify_newip.py when I get an email the last line shows this:

“User email is: “

Where is it looking for the users email address? Trying to figure out where this needs to be populated or sent from. I am using these arguments for the script:

Arguments passed from Tautulli
-sn {show_name} -ena {episode_name} -ssn {season_num00} -enu {episode_num00} -srv {server_name} -med {media_type}
-pos {poster_url} -tt {title} -sum {summary} -lbn {library_name} -ip {ip_address} -us {user} -uid {user_id}
-pf {platform} -pl {player} -da {datestamp} -ti {timestamp}
“”"

@almontef - The script seems to rely heavily on your Tautulli API key for obtaining email, and would seem to write success or error to the Tautulli notify (or API?) logs. (at least, API would show the request, if not returnning it successfully)
Do you have your Tautulli API key in the script parameters at line 22?
Have you checked your API and notify logs in Tautulli?

I do have the Tautulli api set in the script. I believe it’s getting everything else for there just not the email for some reason. Here is the log when the script was triggered:
2018-10-14 12:49:56 DEBUG Tautulli Notifiers :: Script returned:
Successfully retrieved geolocation data.Successfully retrieved user email data.Successfully retrieved UserIPs data.IP has no history.Successfully sent Tautulli notification.
2018-10-14 12:49:56 INFO Tautulli Notifiers :: Email notification sent.
2018-10-14 12:49:52 INFO Tautulli NotificationHandler :: Preparing notification for notifier_id 1.
2018-10-14 12:49:18 DEBUG Tautulli Notifiers :: Executing script in a new thread.
2018-10-14 12:49:18 DEBUG Tautulli Notifiers :: Full script is: [‘python’, ‘C:\JBOPS-master\notify\notify_newip.py’, ‘-sn’, ‘’, ‘-ena’, ‘The Proposal’, ‘-ssn’, ‘00’, ‘-enu’, ‘00’, ‘-srv’, ‘Kuiper’, ‘-med’, ‘movie’, ‘-pos’, ‘https://i.imgur.com/DgQ6kjW.jpg’, ‘-tt’, ‘The Proposal’, ‘-sum’, “When she learns she’s in danger of losing her visa status and being deported, overbearing book editor Margaret Tate forces her put-upon assistant, Andrew Paxton, to marry her.”, ‘-lbn’, ‘Movies’, ‘-ip’, ‘166.***.***.***’, ‘-us’, ‘user1’, ‘-uid’, ‘10743735’, ‘-pf’, ‘Android’, ‘-pl’, ‘Galaxy S8+’, ‘-da’, ‘2018-10-14’, ‘-ti’, ‘12:49’]

DEBUG Tautulli Notifiers :: Full script is: [‘python’, ‘C:\JBOPS-master\notify\notify_newip.py’, ‘-sn’, ‘’, ‘-ena’, ‘The Proposal’, ‘-ssn’, ‘00’, ‘-enu’, ‘00’, ‘-srv’, ‘Kuiper’, ‘-med’, ‘movie’, ‘-pos’, ‘https://i.imgur.com/DgQ6kjW.jpg’, ‘-tt’, ‘The Proposal’, ‘-sum’, “When she learns she’s in danger of losing her visa status and being deported, overbearing book editor Margaret Tate forces her put-upon assistant, Andrew Paxton, to marry her.”, ‘-lbn’, ‘Movies’, ‘-ip’, ‘166.***.***.***’, ‘-us’, ‘user1’, ‘-uid’, ‘10743735’, ‘-pf’, ‘Android’, ‘-pl’, ‘Galaxy S8+’, ‘-da’, ‘2018-10-14’, ‘-ti’, ‘12:49’]
2018-10-14 12:49:18 DEBUG Tautulli Notifiers :: Trying to run notify script, action: play, arguments: [u’-sn’, ‘’, u’-ena’, u’The Proposal’, u’-ssn’, ‘00’, u’-enu’, ‘00’, u’-srv’, u’Kuiper’, u’-med’, u’movie’, u’-pos’, u’https://i.imgur.com/DgQ6kjW.jpg’, u’-tt’, u’The Proposal’, u’-sum’, u"When she learns she’s in danger of losing her visa status and being deported, overbearing book editor Margaret Tate forces her put-upon assistant, Andrew Paxton, to marry her.", u’-lbn’, u’Movies’, u’-ip’, u’166.***.***.***’, u’-us’, u’User1’, u’-uid’, ‘10743735’, u’-pf’, u’Android’, u’-pl’, u’Galaxy S8+’, u’-da’, u’2018-10-14’, u’-ti’, ‘12:49’

That username seems unusual - do you actually have a Plex user account with the name “user1”
Can they log into plex.tv/web?
Is there an actual email address associated with user1?

@blacktwin - I’m likely out of my realm here.

@almontef
The email address the user used when they signed up for Plex is the email address that should show up in the email body. Nothing for you to input, it’s pulled from Tautulli from Plex. If the user is a Home User then they may not have an email address.

I just replaced the username with user1 when I posted the log. It is in fact a managed user and therefore does not have a email address in Plex. So looks like it’s working as designed given that it’s a managed user. @blacktwin not sure if you consider it worth the effort to add some logic into the script where if there is no email address present the script could mention that is potentially a managed user. Not a real big deal at all though given that the admin should know. Slick script!!!

@Blacktwin I recently updated Plex to Plex-Media-Server-1.14.0.5468-5a0183d2c and updated to your latest script for playlist manager.

I noticed a couple of things:

  1. When running the update for my popular movies it does it for my tv shows and when I update my popular movies it updates my tv shows

  2. When I run an update for history, it removed my existing playlist which is normal but never created the new one. Here is the output from a test run which says it is creating the playlist but then just goes to done. I don’t see any errors in Plex or Tautulli logs so kind of stumped.

1 is not so much an issue for me since I got to schedules that run updates for popular and tv shows, but figured I mention it. 2 is an issue though as I would really like to get that working again. Any tips or suggestions greatly appreciated.

Ok. The first problem has been fixed. I mismatched the title to the selector. The second issue may actually be that nothing in your TV Shows library had something that aired that day in history. Can you confirm this? You can use Plex’s filters to find out if this is True or not.

Thanks, I managed to notice that selection mismatch and made the change. However, for some reason history is not working at least for me. Workaround I have is to use your old script (second commit) and use that script via cron to genrate the aired today and your latest script for the popular movies and tv playlists. Not ideal but works.

@Blacktwin

While not a ‘new’ request, I’m sure, but would you mind taking a stab at syncying Trakt status to Tautulli (and vice versa…)?

If I missed an earlier request or relevant info, I apologize.