Created
January 15, 2018 22:44
-
-
Save JonnyWong16/8386ad30e8af5e25a9f2b883823a2bc1 to your computer and use it in GitHub Desktop.
Kill a Plex stream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
PLEXPY_URL = 'http://localhost:8181' | |
APIKEY = 'xxxxxxxxxx' | |
MESSAGE = 'Your stream was terminated for "reasons"' | |
session_id = sys.argv[1] | |
payload = {'apikey': APIKEY, | |
'cmd': 'terminate_session', | |
'session_id': session_id, | |
'message': MESSAGE} | |
r = requests.post(PLEXPY_URL.rstrip('/') + '/api/v2', params=payload} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment