diff --git a/killstream/kill_trans_pause.py b/killstream/kill_trans_pause.py index 5173852..4f51210 100644 --- a/killstream/kill_trans_pause.py +++ b/killstream/kill_trans_pause.py @@ -36,11 +36,12 @@ def kill_session(sess_key): print('Ignoring {}\'s paused transcode stream.'.format(user)) exit() state = session.players[0].state - trans_dec = session.transcodeSessions[0].videoDecision - if session.sessionKey is sess_key and state == 'paused' and trans_dec == 'transcode': - title = (session.grandparentTitle + ' - ' if session.type == 'episode' else '') + session.title - print('Killing {user}\'s stream for pausing a transcode stream of {title}.'.format(user=user, title=title)) - session.stop(reason=MESSAGE) + if session.transcodeSessions: + trans_dec = session.transcodeSessions[0].videoDecision + if session.sessionKey is sess_key and state == 'paused' and trans_dec == 'transcode': + title = (session.grandparentTitle + ' - ' if session.type == 'episode' else '') + session.title + print('Killing {user}\'s stream for pausing a transcode stream of {title}.'.format(user=user, title=title)) + session.stop(reason=MESSAGE) if __name__ == '__main__':