From d8a45ab366ae02c2b73ee2ecafe406397a197ad9 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Fri, 6 Jun 2014 14:13:15 -0400 Subject: [PATCH] More handling of missing names and addresses. --- plugins/video/video.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/video/video.py b/plugins/video/video.py index 8d1318e..c2eb84e 100644 --- a/plugins/video/video.py +++ b/plugins/video/video.py @@ -151,7 +151,10 @@ class Pushable(object): if value.get('name') == tsn: tsn = key break - tivo_name = config.tivos[tsn].get('name', tsn) + try: + tivo_name = config.tivos[tsn]['name'] + except: + tivo_name = tsn container = quote(query['Container'][0].split('/')[0]) ip = config.get_ip(tsn) @@ -202,9 +205,10 @@ class BaseVideo(Plugin): def send_file(self, handler, path, query): mime = 'video/x-tivo-mpeg' tsn = handler.headers.getheader('tsn', '') - if tsn: + try: + assert(tsn) tivo_name = config.tivos[tsn].get('name', tsn) - else: + except: tivo_name = handler.address_string() is_tivo_file = (path[-5:].lower() == '.tivo') -- 2.11.4.GIT