From 1ca9fd5f7d7dd72d69368d8340714012ef9feb7c Mon Sep 17 00:00:00 2001 From: lucas_nz Date: Mon, 7 Feb 2011 14:08:32 +1300 Subject: [PATCH] added togo_mpegts setting to server section of pytivo.conf, values: enabled: show mpeg-ts option on togo screen default: default to ticking mpeg-ts option on togo screen false: not set: does not show mpeg-ts option on togo screen --- plugins/togo/templates/npl.tmpl | 5 +++++ plugins/togo/togo.py | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/togo/templates/npl.tmpl b/plugins/togo/templates/npl.tmpl index 3145ccc..ae5d683 100644 --- a/plugins/togo/templates/npl.tmpl +++ b/plugins/togo/templates/npl.tmpl @@ -147,6 +147,11 @@ function toggle(source) { Decrypt with tivodecode
#end if Save metadata to .txt
+#if $togo_mpegts == 'default' + Transfer as mpeg-ts
+#elif $togo_mpegts == 'enabled' + Transfer as mpeg-ts
+#end if

diff --git a/plugins/togo/togo.py b/plugins/togo/togo.py index d0568f4..92845e9 100644 --- a/plugins/togo/togo.py +++ b/plugins/togo/togo.py @@ -82,6 +82,7 @@ class ToGo(Plugin): folder = '' tivo_mak = config.get_server('tivo_mak') has_tivodecode = bool(config.get_bin('tivodecode')) + togo_mpegts = config.get_server('togo_mpegts').lower() if 'TiVo' in query: tivoIP = query['TiVo'][0] @@ -182,6 +183,7 @@ class ToGo(Plugin): if tivoIP in queue: t.queue = queue[tivoIP] t.has_tivodecode = has_tivodecode + t.togo_mpegts = togo_mpegts t.tname = tivo_name t.tivoIP = tivoIP t.container = cname @@ -227,7 +229,10 @@ class ToGo(Plugin): auth_handler.add_password('TiVo DVR', url, 'tivo', mak) try: - handle = self.tivo_open(url) + if status[url]['ts_format']: + handle = self.tivo_open('%s&Format=video/x-tivo-mpeg-ts' % url) + else: + handle = self.tivo_open(url) except IOError, e: status[url]['running'] = False status[url]['error'] = e.code @@ -311,10 +316,11 @@ class ToGo(Plugin): urls = query.get('Url', []) decode = 'decode' in query save = 'save' in query + ts_format = 'ts_format' in query for theurl in urls: status[theurl] = {'running': False, 'error': '', 'rate': '', 'queued': True, 'size': 0, 'finished': False, - 'decode': decode, 'save': save} + 'decode': decode, 'save': save, 'ts_format' : ts_format} if tivoIP in queue: queue[tivoIP].append(theurl) else: -- 2.11.4.GIT