JBOPS - Just a Bunch Of Plex Scripts

@PaddyOFurniture - Limiter can be set depending on various things, time of day, play start, both variable and static settings.
The limiter readme seems to explain that. What specifically are you having trouble with/what settings and triggers are you using?

1 Like

@JamminR I read the readme, but maybe I am missing something. I set the script to allow 5 plays before kills the stream. The trigger that is set is on Play. I am not setting any arguments at all. In the example today, the user had already watched 12 episodes, so every new episode it would kill the stream and make them wait 30 seconds (that is the wait value I set).

I was hoping that after they restarted their stream, they could watch their limit again.

What line are you passing the script?
--jbop .... etc ... etc ...

–jbop limit --username {username} --sessionId {session_id} --grandparent_rating_key {grandparent_rating_key} --limit plays=5 --delay 30 --killMessage “Are you still watching? If so, please wait 30 seconds and restart your stream, thanks!”

@blacktwin - can there be two --limits, such as --limit plays=4 --limit time=5 so as to prevent X plays within a Y time period, before requiring the client to start a new session again.

Add --today to only check history for that day. Works best for late night binge sleepers. So the time range would be 12am to 4am. I need to add more ranges for the history searching. Like 2 days, week, and month.

@JamminR I don’t think you can. I’d have to test it to confirm though.

In my example that wouldn’t help, correct? By the time I added the script the user had already watched 12 episodes by 5am.

Huh?
If you set the notification agent’s conditions to check from 12am-4am and added the --today argument it would start killing streams once they hit the 5 played limit. Each day the script would only check for history for that day. So everyday from 12am-4am this user would only be able to watch 5 episodes before receiving the kill messages.

@JamminR I had to reread your comment. The --limit time is for total time not a time period, iirc. --limit hours=5 limit user to 5 hour of play time. --limit plays=5 limit user to 5 plays.

@Blacktwin
Understood. I was hoping to limit plays per var hours instead of full day or multiple agents. (Well not me, but hoping to help paddy)

Thanks for clearing it up. It helps to limit the time window, I just wish there was a way that after the first kill of the stream it would reset the count.

I just wish there was a way that after the first kill of the stream it would reset the count.

Increase the limit.

Ok, now I’m looking into limiter.
I have a friend’s kid playing non-stop cartoon show.
And
I
mean
non-stop.
I want to stop them every >x< plays, but, allow them to start another >x< plays manually no matter how long or short time it’s been since last kill.
Basically, I just want to make sure they’re being interactive and not just as background noise.
Can limiter do that as is?
The length of the show could be ~20min, or ~50, so I don’t really want to do any math on time limit if I don’t have to.

Yeah that is exactly what’s happening for me. I am confident they are just using it as background noise or falling asleep to it. I don’t want to be so punitive that after some number of plays they are cut off for the day. Honestly I wish Plex would allow a server setting that would override auto player.

Hey @Blacktwin I;ve been struggling for weeks now on the script to limit streams to one unique IP, may I get some help on this please ?

Cheers !

Yes, limiterr should work for that.

Sure. Where are you stuck? Can you provide logs? If you use Discord, you’ll get a faster response.

I encountered exactly same issue when using tautulli released by qnapclub.
seems to be caused by python packaged with tautulli package.
I switched to docker release and the issue is solved, just need to map jbops location when creating docker container.

1 Like

@Blacktwin - All the examples for the readme are ‘time’ related.
Pardon my (and @PaddyOFurniture)'s ignorance, but could you provide an example command line?
Say I want to limit user to 5 “auto” plays, then they manually have to press ‘play’ again.
Would their session ID change so the script wouldn’t limit them anymore?

--jbop watch --username {username} --sessionId {session_id} --limit plays=5 --killMessage "You have met 5 autoplay limit - please press play next to continue."

That seems like it would limit to 5 plays, and never allow play again.

The playqueue would have to consist of 1 show with multiple episodes. Either a playlist or pressing play at the Show or Season level. So you’d be able to limit 5 auto plays (episodes) of 1 show. You would use this example with or without the conditions.

--jbop limit --username {username} --sessionId {session_id} --grandparent_rating_key {grandparent_rating_key} --limit plays=5 --delay 60 --killMessage "Wait 60 seconds to start playing again."

In the case of a playqueue with multiple shows, once 1 show reaches the play limit then the next stream is killed and prompts the user to wait before starting again. They will continue to see the kill message after each play after the limit is met.

The example you’ve provided, yes, it would limit to 5 plays then kill any additional attempts to play. I’ve recently updated the script so that by default the script only looks at play/time history for the day. This history search can now be expanded back to however many days you want using the --days argument. This creates a rolling history though. So by setting --days 7 you’d allow for N plays/time in a rolling week (7 days back in history from the day the script is ran) not a calendar week (Sun-Sat).

But what about if someone presses Play from a hub, such as “On Deck” or “Continue Watching”
I understand that may be programmatically difficult, but I’m not going to implement the script if it then limits to 5 and never allows again, or, allows more than 5 because they didn’t use ‘show’ or ‘season’, as, I expect, most of my end users do not.