Inspiration from kill_stream.py but wihtout the need of Plex Pass.
Kill any transconding stream or paused for a long time.
Cons:
- Client IP blocked for 2 minutes
- Plex App could hang or crash
- Can't send messagens to user
- Requires root or sudo privileges
- dsniff
- root or sudo privilege user with NOPASSWD
Sudo setup
IMPORTANT: Only use this if you are NOT running Tautulil as root
Edit /etc/sudoers.d/tautulli.conf
tautulli ALL = (ALL) NOPASSWD: /usr/sbin/tcpkill
tautulli ALL = (ALL) NOPASSWD: /usr/bin/timeout
Replace tautulli
with service username.
Find systemd service user:
$ grep 'User=' /etc/systemd/system/tautulli.service
$ wget -O kill_stream.sh https://gist.githubusercontent.com/Generator/9da560853ce7001e188fcfb30ea673ca/raw/kill_stream.sh
$ chmod +x kill_stream.sh
Commum Scripts Settings in Tautulli:
Taultulli > Settings > Notification Agents > Add a Notification Agent > Script
Set Script Folder
Select kill_stream.sh
Script Timeout 0
Triggers: Playback Start
Conditions: [ Transcode Decision
| is
| transcode
]
Arguments: Playback Start: -H {ip_address} -k
Triggers:
- Playback Pause
- Playback Resume
Arguments:
- Playback Pause:
-H {ip_address} -p
- Playback Resume:
-r
Triggers:
- Playback Pause
- Playback Resume
Arguments:
Use -t <MINUTES>
to specify time to wait till kill the paused stream.
In this example the stream will be killed after 10 minutes.
- Playback Pause:
-H {ip_address} -t 10 -p
- Playback Resume:
-r
-H IP - Kill selected IP
-i dev - Custom Network device
-G gateway - Custom Router gateway [ exclude gateway ]
-t time - Paused time [default 20 minutes]
-p - Kill paused stream
-r - Resumed stream
-h | --help - Help
Hey man, absolutely loving that you came up with this. As far as I can tell, it is properly setup on my end. Showing debug log entries that seem right and have these under notification logs https://i.imgur.com/anmIx7V.png
But while actively testing and playing a transcode, the stream is not killed and my client is still able to connect/use the server. What could I be doing wrong here? Any other info I can send your way to help?
Thanks in advance for your help!
EDIT:
Just dawned on me this might be a restriction of my setup using nginx and cf as a CDN? When trying to load a direct page, the host was denied.