Comments (16)
Ok, found the problem. I've update the script. Please try again.
from jbops.
I just tried the updated script and now in the logs, when testing with same account in the same lan, the log show "Killing (users's) second stream of (movie) for (reason)." appears. It doesn't kill the stream since it's on the same network but it does not log the correct log dealing with same IP.
from jbops.
@irodimus do you have a Plex Pass?
from jbops.
Yes. Lifetime.
I should add that it does work at stated when on different networks. Tried form a Roku on the network and a smartphone on cellular.
My observation wasn't that it didn't work but that it did not log correctly when on the devices were on the same network.
from jbops.
@irodimus if you see that message then the second stream should be getting killed. For your testing is everything local to the plex server?
from jbops.
Now this is interesting. I have a plex preroll play before the movie, just 1, and I get the correct log with "Not killing (user) second stream. Same IP." but once that's over and the movies starts, it logs the "Killing (users's) second stream of (movie) for (reason)." This time though it does kill the stream, but it weird that it does that since it's still on the same network.
from jbops.
For your testing is everything local to the plex server?
Is your server and clients on the same network? Unless you are running two chrome tabs with Plex on that one machine, your IPs will be different.
Looks like I need to account for local admin plays. But really this can be handled with conditions to not check on admin streams.
from jbops.
Yup, server is local and the clients (iPhone, Roku and Plex Web on a computer) are on the same network. As stated above, it starts working fine when the preroll plays but when the movie starts, it errors.
EDIT: I guess I can put the admin account on the ignore list, but I was hoping it would work fine when testing on the account I use.
from jbops.
In the logs does the IP change after the preroll? Seems odd. Can you provide a little more detail on how you're testing? Start client 1 (roku), wait 30 seconds, start client 2 (plex web), etc.
from jbops.
According to the logs, it's the same IP. I have a TV showing playing currently on the Roku on loop, so I just started a movie on the iPhone or Plex Web on the computer. That's about it. I'm starting to think the preroll is messing things up.
from jbops.
Here's is a snippet of the log:
2018-03-24 21:17:28 - INFO :: MainThread : Checking if the database upgrades are required...
2018-03-24 21:17:28 - DEBUG :: MainThread : Altering database. Renaming notifiers.
2018-03-24 21:17:28 - INFO :: MainThread : Checking if configuration upgrades are required...
2018-03-24 21:17:28 - DEBUG :: MainThread : Trying to execute: "git rev-parse HEAD" with shell in /Applications/Plex Scripts/Tautulli
2018-03-24 21:17:29 - DEBUG :: MainThread : Git output: 244008d539bc2aeb2a09b18d9fb4d7331e27798f
2018-03-24 21:17:29 - DEBUG :: MainThread : Trying to execute: "git rev-parse --abbrev-ref --symbolic-full-name @{u}" with shell in /Applications/Plex Scripts/Tautulli
2018-03-24 21:17:29 - DEBUG :: MainThread : Git output: origin/beta
2018-03-24 21:17:29 - INFO :: MainThread : Retrieving latest version information from GitHub
2018-03-24 21:17:29 - DEBUG :: MainThread : Requesting URL via GET method: https://api.github.com/repos/Tautulli/Tautulli/commits/beta
2018-03-24 21:17:29 - DEBUG :: MainThread : Latest version is 244008d539bc2aeb2a09b18d9fb4d7331e27798f
2018-03-24 21:17:29 - INFO :: MainThread : Tautulli is up to date
2018-03-24 21:17:29 - INFO :: MainThread : Tautulli PlexTV :: Requesting resources for server...
2018-03-24 21:17:30 - INFO :: MainThread : Tautulli PlexTV :: Using user-defined URL.
2018-03-24 21:17:30 - INFO :: MainThread : Tautulli Config :: Writing configuration to file
2018-03-24 21:17:30 - INFO :: MainThread : Tautulli Users :: Requesting users list refresh...
2018-03-24 21:17:32 - INFO :: MainThread : Tautulli Users :: Users list refreshed.
2018-03-24 21:17:32 - INFO :: MainThread : Tautulli Libraries :: Requesting libraries list refresh...
2018-03-24 21:17:32 - DEBUG :: MainThread : Tautulli Pmsconnect :: No library data.
2018-03-24 21:17:34 - INFO :: MainThread : Tautulli Config :: Writing configuration to file
2018-03-24 21:17:34 - INFO :: MainThread : Tautulli Libraries :: Libraries list refreshed.
2018-03-24 21:17:34 - INFO :: MainThread : Tautulli NotificationHandler :: Starting background notification handler (2 threads).
2018-03-24 21:17:34 - DEBUG :: MainThread : Tautulli Monitor :: Checking for active streams.
2018-03-24 21:17:34 - INFO :: Thread-3 : Tautulli WebSocket :: Opening websocket.
2018-03-24 21:17:34 - INFO :: Thread-3 : Tautulli WebSocket :: Connection attempt 1.
2018-03-24 21:17:34 - INFO :: MainThread : Tautulli WebStart :: Web server authentication is enabled: Tautulli admin (username is 'user') and Plex admin.
2018-03-24 21:17:34 - INFO :: MainThread : Tautulli WebStart :: Starting Tautulli web server on http://0.0.0.0:8181/
2018-03-24 21:17:34 - INFO :: Thread-3 : Tautulli WebSocket :: Ready
2018-03-24 21:17:34 - INFO :: Thread-3 : Scheduled background task: Check GitHub for updates
2018-03-24 21:17:34 - INFO :: Thread-3 : Scheduled background task: Backup Tautulli database
2018-03-24 21:17:34 - INFO :: Thread-3 : Scheduled background task: Backup Tautulli config
2018-03-24 21:17:34 - INFO :: Thread-3 : Scheduled background task: Refresh Plex server URLs
2018-03-24 21:17:34 - INFO :: Thread-3 : Scheduled background task: Check for Plex remote access
2018-03-24 21:17:34 - INFO :: Thread-3 : Scheduled background task: Check for Plex updates
2018-03-24 21:17:34 - INFO :: Thread-3 : Scheduled background task: Refresh users list
2018-03-24 21:17:34 - INFO :: Thread-3 : Scheduled background task: Refresh libraries list
2018-03-24 21:18:23 - DEBUG :: Thread-3 : Tautulli ActivityHandler :: Session 211 paused.
2018-03-24 21:18:23 - INFO :: Thread-1 : Tautulli NotificationHandler :: Preparing notifications for notifier_id 4.
2018-03-24 21:18:23 - DEBUG :: Thread-1 : Tautulli Notifiers :: Trying to run notify script, action: pause, arguments: [u'211']
2018-03-24 21:18:23 - DEBUG :: Thread-1 : Tautulli Notifiers :: Full script is: ['python', u'/Applications/Plex Scripts/Tautulli/scripts/wait_kill_pause_notify_main.py', u'211']
2018-03-24 21:18:23 - DEBUG :: Thread-1 : Tautulli Notifiers :: Executing script in a new thread.
2018-03-24 21:18:53 - WARNING :: Thread-16 : Tautulli Notifiers :: Script exceeded timeout limit of 30 seconds. Script killed.
2018-03-24 21:19:07 - DEBUG :: Thread-3 : Tautulli ActivityHandler :: Session 211 resumed.
2018-03-24 21:19:14 - DEBUG :: Thread-3 : Tautulli ActivityHandler :: Session 212 started by user 1065317 (user) with ratingKey 897470 (Home Theater Preroll).
2018-03-24 21:19:14 - INFO :: Thread-1 : Tautulli NotificationHandler :: Preparing notifications for notifier_id 1.
2018-03-24 21:19:14 - INFO :: Thread-2 : Tautulli NotificationHandler :: Preparing notifications for notifier_id 2.
2018-03-24 21:19:14 - INFO :: Thread-1 : Tautulli Notifiers :: Growl notification sent.
2018-03-24 21:19:14 - INFO :: Thread-1 : Tautulli NotificationHandler :: Preparing notifications for notifier_id 8.
2018-03-24 21:19:14 - DEBUG :: Thread-1 : Tautulli Notifiers :: Trying to run notify script, action: concurrent, arguments: [u'user', u'10.0.1.6', u'212']
2018-03-24 21:19:14 - DEBUG :: Thread-1 : Tautulli Notifiers :: Full script is: ['python', u'/Applications/Plex Scripts/Tautulli/scripts/kill_more_than.py', u'user', u'10.0.1.6', u'212']
2018-03-24 21:19:14 - DEBUG :: Thread-1 : Tautulli Notifiers :: Executing script in a new thread.
2018-03-24 21:19:14 - INFO :: Thread-2 : Tautulli Notifiers :: Prowl notification sent.
2018-03-24 21:19:14 - DEBUG :: Thread-18 : Tautulli Notifiers :: Script returned:
Not killing (user) second stream. Same IP
2018-03-24 21:19:14 - INFO :: Thread-18 : Tautulli Notifiers :: Script notification sent.
2018-03-24 21:19:21 - DEBUG :: Thread-3 : Tautulli ActivityHandler :: Session 212 stopped.
2018-03-24 21:19:21 - DEBUG :: Thread-3 : Tautulli ActivityProcessor :: ratingKey 897470 not logged. Does not meet logging criteria. Media type is 'clip'
2018-03-24 21:19:21 - DEBUG :: Thread-3 : Tautulli ActivityHandler :: Removing sessionKey 212 ratingKey 897470 from session queue
2018-03-24 21:19:24 - DEBUG :: Thread-15 : Tautulli Notifiers :: Script returned:
Executing sub script.
(user) stream of Murdoch Mysteries - War on Terror is now playing.Exiting sub script.
2018-03-24 21:19:24 - DEBUG :: Thread-3 : Tautulli ActivityHandler :: Session 213 started by user 1065317 (user) with ratingKey 904603 (Lean On Me).
2018-03-24 21:19:24 - INFO :: Thread-1 : Tautulli NotificationHandler :: Preparing notifications for notifier_id 1.
2018-03-24 21:19:24 - INFO :: Thread-2 : Tautulli NotificationHandler :: Preparing notifications for notifier_id 2.
2018-03-24 21:19:24 - INFO :: Thread-1 : Tautulli Notifiers :: Growl notification sent.
2018-03-24 21:19:24 - INFO :: Thread-1 : Tautulli NotificationHandler :: Preparing notifications for notifier_id 8.
2018-03-24 21:19:24 - DEBUG :: Thread-1 : Tautulli Notifiers :: Trying to run notify script, action: concurrent, arguments: [u'user', u'10.0.1.6', u'213']
2018-03-24 21:19:24 - DEBUG :: Thread-1 : Tautulli Notifiers :: Full script is: ['python', u'/Applications/Plex Scripts/Tautulli/scripts/kill_more_than.py', u'user', u'10.0.1.6', u'213']
2018-03-24 21:19:24 - DEBUG :: Thread-1 : Tautulli Notifiers :: Executing script in a new thread.
2018-03-24 21:19:25 - INFO :: Thread-2 : Tautulli Notifiers :: Prowl notification sent.
2018-03-24 21:19:25 - DEBUG :: Thread-20 : Tautulli Notifiers :: Script returned:
Killing (user) second stream of Lean On Me for Stream stopped due to more than one stream already playing.
2018-03-24 21:19:25 - INFO :: Thread-20 : Tautulli Notifiers :: Script notification sent.
from jbops.
@kalyway are you still having an issue?
@irodimus It looks like pre-rolls and trailers don't show up in the active sessions. So Tautulli will see that there is a second stream but plexapi's session check won't show the trailer/pre-roll session so if
statement sees that there is only 1 sessions with the reported IP instead of 2 sessions with the reported IP. I've added an additional if check. I might want to use Tautulli's get_activity
for this instead of the plexapi sessions.
from jbops.
@blacktwin I just downloaded the updated script. It works PERFECT for one user streaming on different networks. HOWEVER, the main problem is if they are on the same network. Any other streams on the same network are listed under the same IP..
from jbops.
@kalyway I'm not sure I understand. If a user is at their home (remote from your server) and has multiple streams coming from their home then those streams' IPs will be the same.
from jbops.
Yes. That is correct. I'm just saying that it would be nice to, instead of doing it based on IP, do it based on concurrent streams. If the stream is greater than 1, kill 2nd stream. Or something like that :P
from jbops.
You can already do that with Plex by limiting the amount of remote streams.
from jbops.
Related Issues (20)
- Sync_watch_status =/= Plex token HOT 8
- hide_episode_spoilers.py - blur not removed HOT 1
- [Bug] Same server never evaluates to `true` in Sync Watch Status script HOT 1
- Send email to removed users
- Issue with find_unwatched.py deleting new content HOT 1
- Issue - merge_multiepisodes.py not allowing --composite_thumb HOT 1
- FileNotFoundError: [Errno 2] No such file or directory when Plex server runs on docker HOT 2
- Request - Better combine the episode names for multi-part episodes
- Failed to access uri endpoint for delete_watched_tv script HOT 1
- Plex Poster Pull - Cannot seem to authenticate
- [Issue] Tautulli NotificationHandler :: {1} media_type | is | 'show or season or episode' > 'episode' > False
- Request [Feature Request] hide also episode title for hide_episode_spoilers.py
- Migrate Transcodes to Backup Server HOT 2
- Sync Watch Status Auth Error HOT 2
- Request improvement of utility/delete_watched_TV.py
- Request dovi profile killswitch
- Inactive User script fails when trying to remove a user
- Launches temporary command window when script is executed
- Can we use this scripts with Python 3.12.4
- Remove Inactive Users API Issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jbops.