Closed Anuruddha094 closed 3 years ago
Why even include a dummy log...
You're one example up from the example you want to use.
Why even include a dummy log...
You're one example up from the example you want to use.
@blacktwin Thank you very much for the reply. I'm sorry I didn't add the log files. I thought it's not necessary as I just need know what this script exactly doing with those arguments.
here is my log: https://gist.github.com/Anuruddha094/bac8a3b76042c98b09ce8e40b3c70b91
cheers
2021-04-06 19:31:38 - DEBUG :: Thread-154 : Tautulli Notifiers :: Script returned: Total time (99) is less than limit (7200).
They haven't reached the two hours.
The total count resets on every tautulli restarts.
Why are you restarting it often? Your logs are not showing any restarts and only one reference to the script running.
After that script should kill the play back even user try to play something after 7 days etc.
I think I misread this initially, you had the correct example.
--jbop time --username {username} --sessionId {session_id} --limit hours=2 --killMessage "You have met your limit of 2 hours."
--limit days=0
is not needed.
@blacktwin thank you very much for the great support. Actually I'm not restarting tautulli every time. If any case if I restart my pc for windows update or something.
--jbop time --username {username} --sessionId {session_id} --limit hours=2 --killMessage "You have met your limit of 2 hours.
So basically if I add --limit days=0
argument, script will reset the counter every 24 hours and if I removed it, it won't reset anymore. so it kills the stream after it exceed 7200 seconds for particular user even he plays something after 7 days or so on. Did I get it correct?
cheers
So basically if I add --limit days=0 argument, script will reset the counter every 24 hours
No. --limit days=0
is just not needed. Just like adding --limit minutes=0
would be not needed. You don't need to account for a 0 value.
it kills the stream after it exceed 7200 seconds for particular user even he plays something after 7 days or so on.
Yes, using the example provided above, this is the expected behavior.
@blacktwin thank you very much. That's what I exactly needed. So user never ever can play anything after he exceeded 7200 seconds and until I manually add a condition to skip the script for particular user.
cheers.
@blacktwin Hi I'm back. It looks like script reset the counter to zero every 24 hours. any fix for it?
thank you.
Logs? Your entire Tautulli log, please.
Logs? Your entire Tautulli log, please.
@blacktwin sorry I didn't attached logs earlier. Here is my 2 days tautulli logs for your examination.
log: https://gist.github.com/Anuruddha094/ff101c72f054117ecdc079c0335140f4
Thank you for your fantastic support.
Ok, I see it. Let me figure out whats happening. It been awhile since I've touched this script.
Ok, I see it. Let me figure out whats happening. It been awhile since I've touched this script.
@blacktwin thank you very much.
@blacktwin I played a movie just before 12AM and just after 12AM. I can confirm script reset the counter to zero after 12AM. Please find the bold text on the log.
For your reference I extrated script return part from the log.
2021-04-12 23:59:15 - DEBUG :: Thread-549 : Tautulli Notifiers :: Script returned: Total time (247) is less than limit (7200).
2021-04-12 23:59:39 - DEBUG :: Thread-556 : Tautulli Notifiers :: Script returned: Total time (264) is less than limit (7200).
2021-04-13 00:05:46 - DEBUG :: Thread-571 : Tautulli Notifiers :: Script returned: Total time (7) is less than limit (7200).
new log: https://gist.github.com/Anuruddha094/14705a998d54dfcba0e379c64afb3488
thank you for your help.
cheers
You're one example up from the example you want to use.
So I did have this right, haha. The "issue" is that the default value for the --days
arg is set to 0
. Without setting that arg it will result in using that 0
value for the amount of days to go back into history. The solution for your issue would be to add --days 365
.
--jbop time --username {username} --sessionId {session_id} --days 365 --limit hours=2 --killMessage "You have met your limit of 2 hours."
It doesn't have to be that extreme though as I'm not sure how that extreme of a value would impact the script's time to process. Not really sure why you would limit an user this way. I would suggest adding --notify
to have the script notify you when that limit is reached, then you can manage that user however you see fit.
--jbop time --username {username} --sessionId {session_id} --days 365 --limit hours=2 --notify 1 --killMessage "You have met your limit of 2 hours."
@blacktwin Thank you very much for your reply. I also thought about 365 days will solved the issue. But I wait for your reply. I will apply those arguments and let you know the results. I guess in this way script will reset the counter in every 365 days.
thank you.
If you have someone that you want to prevent from having access just unshare your libraries or remove them. Like the other issue you helped with (thank you by the way) there is a limit to what the script can do and a time when intervention is required.
@blacktwin yes it's a good idea to remove a user from plex shared libraries. My main issue is some users make more stress on my plex server. I just need to limit them without removing them because they are my friends. If they contact me, may be I can allow them to watch more than 2 hours.
thank you very much for your scrips and excellent support.
cheers.
@blacktwin I'm sorry I'm bit late to reply. I tried --jbop time --username {username} --sessionId {session_id} --days 365 --limit hours=2 --notify 1 --killMessage "You have met your limit of 2 hours."
script and it didn't work at all. Script didn't return anything. I tweak the arguments slightly but I didn't get any successful results. So I have changed it to --jbop time --username {username} --sessionId {session_id} --duration {duration} --days 180 --limit hours=2 --notify 1 --killMessage "You have met your limit of 2 hours."
It's working perfectly. Anyway its not permanently block user but at least for 6 months.
cheers
Hi, I just try to implement Limit user to total time watching. It looks like it's not working as I expected. The total count resets on every tautulli restarts.
my settings:
Triggers: Playback Start, Playback Resume
--jbop time --username {username} --sessionId {session_id} --limit days=0 --limit hours=2 --killMessage "You have met your limit of 2 hours."
my requirement as follows.
I need to allow user to watch only 2 hours. After that script should kill the play back even user try to play something after 7 days etc.
thank you.
Log: https://gist.github.com/Anuruddha094/bac8a3b76042c98b09ce8e40b3c70b91