except for non transcoding sessions

if not transcoding would error out instead of continuing.
This commit is contained in:
blacktwin 2018-01-03 11:37:02 -05:00 committed by GitHub
parent 3a8a46bfd0
commit a2f0d09bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,13 +40,17 @@ def kill_session():
if user in USER_IGNORE or media_type == 'track': if user in USER_IGNORE or media_type == 'track':
print('Ignoring {}\'s {} stream.'.format(user, media_type)) print('Ignoring {}\'s {} stream.'.format(user, media_type))
pass pass
trans_dec = session.transcodeSessions[0].videoDecision try:
if trans_dec == 'transcode': trans_dec = session.transcodeSessions[0].videoDecision
platform = session.players[0].platform if trans_dec == 'transcode':
MESSAGE = DEVICES.get(platform, DEFAULT_REASON) platform = session.players[0].platform
print(MESSAGE) MESSAGE = DEVICES.get(platform, DEFAULT_REASON)
print('Killing {user}\'s stream for transcoding video on {plat}.'.format(user=user, plat=platform)) #print(MESSAGE)
session.stop(reason=MESSAGE) print('Killing {user}\'s stream for transcoding video on {plat}.'.format(user=user, plat=platform))
session.stop(reason=MESSAGE)
except IndexError:
# print('{} not transcoding.'.format(user))
pass
if __name__ == '__main__': if __name__ == '__main__':