Update kill_trans_pause.py

This commit is contained in:
blacktwin 2017-07-31 07:41:14 -04:00 committed by GitHub
parent 738d45c881
commit e1f2768de6

View File

@ -64,11 +64,11 @@ def kill_stream(sessionId, message):
if __name__ == '__main__':
response = fetch('status/sessions')
for s in response['MediaContainer']['Video']:
try:
try:
for s in response['MediaContainer']['Video']:
if s['TranscodeSession']['videoDecision'] == 'transcode' and s['User']['title'] not in USER_IGNORE \
and s['Player']['state'] == 'paused':
print("Killing {}'s stream for pausing a transcode stream of {}".format(s['User']['title'], s['title']))
kill_stream(s['Session']['id'], MESSAGE)
except Exception:
pass
except Exception:
pass