martabal / Plex-stop-transcoding

Script & Docker to stop unwanted transcode streams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plex kill transcode streams

This script allows you to stop streams that use trancoding. Prohibits the use of plex web and Plex Media Player. Allow all users to transcode for SD streams

Requirements

Python3 / requests (usually included with python3)
Tautulli (fantastic app that you should be using and must for this script anyway)
PlexPass

Method 1 : run a shell script in background

The script checks every 20 seconds streams activities.

Install requirements :

run

user:~/plex-kill-transcode-streams$ sudo pip install -r requirements.txt

Edit the bash script (KillstreamLoop.sh):

In this file you need to edit this line: "cd /YOURPATH/killstreamloop.sh && python3 killstream.py"
Specifically you need to edit this part: "/YOURPATH/Tautulli_IP_Enforcer"

To allow accounts to transcode:

Edit the file "authorized.txt" and add the username id followed by a semicolon and the limit of unique IP addresses that are allowed.
For example:

52252389
56428612

will allow 2 precise accounts to transcode streams for this Plex server. If a user is not in the text file then they can't transcode streams. They have to use direct stream or direct play.

Method 2 : Tautulli run itself the script :

Tautulli run the script when a stream starts, resumes or when a stream changes its transcode decision.

Install requirements

user:~/plex-kill-transcode-streams$ sudo pip install -r requirements.txt

Method 3 : Run as docker

Docker run

Edit environment variables and volume

user:~/plex-kill-transcode-streams$ docker build -t stoptranscode .
user:~/plex-kill-transcode-streams$ docker run -e TAUTULLI_PORT=8080 -e TAUTULLI_IP=x.x.x.x  -e TAUTULLI_API=YOURAPIKEY   -v /home/data:/data stoptranscode

Docker compose

Edit docker-compose.yml and run

user:~/plex-kill-transcode-streams$ docker-compose up -d




Script based on https://github.com/Dosk3n/Tautulli_IP_Enforcer

About

Script & Docker to stop unwanted transcode streams

License:MIT License


Languages

Language:Python 95.4%Language:Dockerfile 3.3%Language:Shell 1.3%