# TiVo ToDo list from website



## orangeboy

orangeboy said:


> Has anyone programmatically leveraged the ToDo list found on the TiVo website? I've been attempting to, but I haven't gotten the correct login data passed to get authenticated. I think another hurdle would be selecting a specific TiVo if there were more than one DVR on your account. I've been looking closely at pyTivo's mind.py (that logs into the TiVo mind server) for inspiration and insight since it uses most of the keywords that I believe are required:
> 
> cams_security_domain,
> cams_login_config,
> cams_cb_username,
> cams_cb_password, and
> cams_original_url
> 
> I don't have all of the nuances of python worked out, so it's slow going and error prone. I think one application of using ToDo data would be a step toward cooperative scheduling amongst a group of TiVos. Gathering information about what the tuners are doing at a specific time could be a way of selecting what TiVo to choose when setting up a Season Pass, for example. And to go a step further, use the TiVo website to go ahead and schedule the Season Pass on a DVR with a free tuner at that time...


Since initially writing this post, I've made progress with some of the ideas I had in mind regarding the information available from the TiVo website. I've made my project publicly available using Google Code:


Project Home - Offers a brief overview of the project, and links to available downloads and wiki pages.

Download section - Here you can find stable releases of the application.

Wiki section - Here you can find more in-depth information:

Getting Started - How to install the application.

TiVoToDo Conf File - An explanation of the required and optional configuration settings.

What It Does - Gives a high level view of the steps the application takes to get the information.

And The Results - Gives an example of the csv files that can be created and viewed in a spreadsheet application (Excel, OpenOffice, etc...)

Nuts and Bolts - Insight into some of the variables I created, and the values they represent. This page is geared more for developers and contributers.

Issues section - Here's where to report problems, or submit Enhancement Requests.

Source section - Here you can access beta level versions of the program:
Checkout - Provides the subversion command to download the latest revision committed.

Browse - Here you can review/preview source code committed to the project (so far, everything is found in /trunk)

Changes - Here you can find a change history for the components of the project. Clicking on one of the changes opens a new page that offers a "diff" link. This will show what changes were made between the current revision and the previous revision.


This project is written in the 2.x version of the python language. Trying to run it using 3.x will result in failure.


----------



## orangeboy

OK, after much trial and error and looking more closely at the tivo.com source html, the following will get the html page that contains the first 20 entries of the ToDo list for the DVR specified by "tsn":



Code:


#!/usr/bin/python
#TiVoToDo.py

import sys
import os.path
import urllib
import urllib2
import cookielib

email = sys.argv[1]
password = sys.argv[2]
tsn = sys.argv[3]
urlopen = urllib2.urlopen
Request = urllib2.Request

cookiefile = 'cookies.lwp'

cj = cookielib.LWPCookieJar()

if os.path.isfile(cookiefile):
    cj.load(cookiefile)

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)

url = 'https://www3.tivo.com/tivo-tco/login.do'
data = urllib.urlencode({
    'cams_cb_partner': None,
    'cams_security_domain': 'tivocom',
    'cams_login_config': 'http',
    'cams_original_url': '/tivo-tco/go.do?def=tco.todo.page&tsn=' + tsn,
    'cams_cb_username': email,
    'cams_cb_password': password,
    'remember_email': 'true',
    'cams_cb_rememberme': 'true'
})

header =  {
    'User-agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
}

try:
    req = Request(url, data, header)
    handle = urlopen(req)
except IOError, e:
    print 'We failed to open "%s".' % url
    if hasattr(e, 'code'):
        print 'We failed with error code - %s.' % e.code
else:
    print handle.read()
cj.save(cookiefile)

At this time, it's still parsing command line arguments. Adding in a Config Parser should make less command line arguments.

To invoke:


Code:


TiVoToDo.py "username" "password" "6480001########"

It's not very pretty so far, and only the ability to get to the page has been accomplished.


----------



## moyekj

Pretty cool, well done. Have you tracked how up to date the ToDo list is on tivo.com? Is it updated with daily net connect only or is it updated with each VCM connection? I remember the Now Playing List was not very up to date and missed things such as MRV transfers.


----------



## orangeboy

moyekj said:


> Pretty cool, well done. Have you tracked how up to date the ToDo list is on tivo.com? Is it updated with daily net connect only or is it updated with each VCM connection? I remember the Now Playing List was not very up to date and missed things such as MRV transfers.


Thank you! 
So far, my Series3 and Premiere are pretty much current on the site, so my guess would be the VCM connection. A better test would be my Series2 which has 48 manual (30 minute) recordings to support my security camera, but that ToDo list doesn't show up at all on the site! I'm wondering if that many entries (48 entries per day x ~12 days of guide data = 576 entries in the worst case) is too much for the ToDo app at tivo.com. I'll keep my eye out for discrepancies, should any become evident!


----------



## gonzotek

orangeboy said:


> Thank you!
> So far, my Series3 and Premiere are pretty much current on the site, so my guess would be the VCM connection. A better test would be my Series2 which has 48 manual (30 minute) recordings to support my security camera, but that ToDo list doesn't show up at all on the site! I'm wondering if that many entries (48 entries per day x ~12 days of guide data = 576 entries in the worst case) is too much for the ToDo app at tivo.com. I'll keep my eye out for discrepancies, should any become evident!


I'm pretty sure the S2 tivos don't have support for the website NPL and ToDo lists.


----------



## orangeboy

gonzotek said:


> I'm pretty sure the S2 tivos don't have support for the website NPL and ToDo lists.


Yep, confirmed:


> Online Now Playing and To Do Lists are not available for Series2 customers at this time.


----------



## tomm1079

wow very nice....putting this together with that advanced now playing list could give some good in via a web browser...


----------



## orangeboy

I got a bit further. I gather DVR names and their TSNs from '/tivo-tco/go.do?def=tco.nowplaying.page', and stealing some code from WMcBrine, check to see if they are HD capable. I loop only through those DVRs that are HD, and gather the ToDo Lists from the tivo site into a single list. Right now, all I'm doing is presenting the data at a command prompt, using a "print" command. I also went ahead and used a little config file to store the TiVo email address and password. There's very little error checking, it's not documented, and I don't know how closely it follows PEP 8 standards. This is my first real stab at using python, so my conventions may not match what you'd find in the rest of the world. 

TiVoToDo.py:


Code:


#!/usr/bin/python
#TiVoToDo.py

import sys
import os.path
import urllib
import urllib2
import cookielib
import ConfigParser

from HTMLParser import HTMLParser
from collections import defaultdict

p = os.path.dirname(__file__)
config = ConfigParser.ConfigParser()
config_files = ['/etc/TiVoToDo.conf', os.path.join(p, 'TiVoToDo.conf')]
configs_found = config.read(config_files)

if not configs_found:
    print ('ERROR: TiVoToDo.conf does not exist.\n' +
           'You must create this file before running TiVoToDo.')
    sys.exit(1)
config.read(config_files)

if not config.has_section('email'):
    print 'TiVo account email required in TiVoToDo.conf'
    sys.exit(1)
email = config.get('email', 'email')
    
if not config.has_section('password'):
    print 'TiVo account password required in TiVoToDo.conf'
    sys.exit(1)
password = config.get('password', 'password')
    
tdl = []
header = {'User-agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}
base_url = 'https://www3.tivo.com'
todo_url = '/tivo-tco/go.do?def=tco.todo.page'
npl_url = '/tivo-tco/go.do?def=tco.nowplaying.page'

cookiefile = 'cookies.lwp'
urlopen = urllib2.urlopen
Request = urllib2.Request
cj      = cookielib.LWPCookieJar()

if os.path.isfile(cookiefile):
    cj.load(cookiefile)

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
    
class TagParser(HTMLParser):
    tdl = []
    tsns = []
    tivos = []
    current_tivo = None
    noShows = False
    def __init__(self):
        HTMLParser.__init__(self)
        self.a_flag = False
        self.a_data = ''
        self.get_data = False
        self.option_flag = False
        self.select_flag = False
        self.span_count = 0
        self.span_flag = False
        self.span_tags = ['day', 'date', 'time']
    
    def handle_starttag(self, tag, attrs):
        if tag == 'a' and page != 'NPL' and attrs != []:
            if attrs[0][1] == 'trigger':
                self.a_flag = True
                self.get_data = True

        if tag == 'div' and page != 'NPL' and attrs != []:
            if attrs[0][1] == 'noShows':
                TagParser.noShows = True
        
        if tag == 'option' and self.select_flag and \
           attrs[0][0] =='value' and page == 'NPL':
            self.option_flag = True
            self.get_data = True
            TagParser.tsns.append(attrs[0][1])
        
        if tag == 'select' and attrs[0][1] == 'DVRlist':
            self.select_flag = True
        
        if tag == 'span' and attrs[0][1] in self.span_tags and page != 'NPL':
            self.span_flag = True
            self.get_data = True
            self.span_count += 1
            
    def handle_data(self, data):
        if self.get_data:
            if self.span_flag:
                TagParser.tdl.append(data)
        
            if self.a_flag:
                self.a_data = self.a_data + data
                
            if self.option_flag:
                TagParser.tivos.append(data)
 
    def handle_endtag(self, tag):
        if tag == 'a' and self.a_flag:
            TagParser.tdl.append(self.a_data.rstrip('\n '))
            TagParser.tdl.append(TagParser.current_tivo)
            self.a_data = ''
            self.a_flag = False
        self.get_data = False
        self.span_flag = False
        self.option_flag = False
        if tag == 'select':
            self.select_flag = False

parser  = TagParser()
        
def login(email, password):
    url = base_url + '/tivo-tco/login.do'
    login_data = urllib.urlencode({
        'cams_cb_partner': None,
        'cams_security_domain': 'tivocom',
        'cams_login_config': 'http',
        'cams_original_url': npl_url,
        'cams_cb_username': email,
        'cams_cb_password': password,
        'remember_email': 'true',
        'cams_cb_rememberme': 'true'
    })
    return url, login_data

def request_url(url, data=None, header=header):
    if data is None:
        data = None
    try:
        req = Request(url, data, header)
        handle = urlopen(req)
    except IOError, e:
        print 'We failed to open "&#37;s".' % url
        if hasattr(e, 'code'):
            print 'We failed with error code - %s.' % e.code
    else:
        result = handle.read()
        parser.feed(result)
        parser.close()
        parser.reset()
    
def isHDtivo(tsn):  # tsn's of High Definition Tivo's
    return bool(tsn and tsn[0] >= '6' and tsn[:3] != '649')

page = 'NPL'
url, login_data = login(email, password)
request_url(url, login_data, header)

tivos = dict(zip(parser.tivos, parser.tsns))

for tivo, tsn in tivos.iteritems():
    TagParser.noShows = False
    if isHDtivo(tsn):
        TagParser.current_tivo = tivo
        page = 'ToDo'
        offset = 0

        while not TagParser.noShows:
            url = base_url + todo_url + '&tsn=' + tsn + '&offset=%d' % offset
            offset += 20
            login_data = None
            request_url(url, login_data, header)

raw_tdl = parser.tdl

for i in range(5, len(raw_tdl), 5):
    nl = raw_tdl[i-5:i]
    a = nl[1].partition('/')
    a = a[0].rjust(2,'0') + a[1] + a[2].rjust(2,'0')
    tdl.append([a, nl[0], nl[2].rjust(8), nl[4].center(8), nl[3].ljust(25)])

tdl.sort()
for i in range(len(tdl)):
    print tdl[i]

print
x = raw_input("Press Enter")
exit ()

Before use, the .conf file needs updated, then stored at the same location as the .py file.

TiVoToDo.conf:


Code:


[email]
email = 

[password]
password =

My results:


Code:


 9:49:18>tivotodo.py
['09/23', 'Thu', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['09/23', 'Thu', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['09/23', 'Thu', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/23', 'Thu', ' 7:30 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/23', 'Thu', ' 8:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/23', 'Thu', ' 8:00 pm', '     TivoS3     ', '     Nova scienceNOW     ']
['09/23', 'Thu', ' 8:00 pm', '     TivoS4     ', '        Community        ']
['09/23', 'Thu', ' 8:00 pm', '    DVR 1FA0    ', '   The Big Bang Theory   ']
['09/23', 'Thu', ' 8:30 pm', '     TivoS4     ', '         30 Rock         ']
['09/23', 'Thu', ' 9:00 pm', '     TivoS3     ', '           NOVA          ']
['09/23', 'Thu', ' 9:00 pm', '     TivoS3     ', 'CSI: Crime Scene Inve ...']
['09/23', 'Thu', ' 9:00 pm', '     TivoS4     ', '          Nikita         ']
['09/23', 'Thu', ' 9:00 pm', '     TivoS4     ', '        The Office       ']
['09/23', 'Thu', ' 9:00 pm', '    DVR 1FA0    ', 'The Real Housewives o ...']
['09/23', 'Thu', '10:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/23', 'Thu', '11:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/23', 'Thu', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['09/23', 'Thu', '11:00 pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/23', 'Thu', '11:30 pm', '     TivoS3     ', "      That '70s Show     "]
['09/24', 'Fri', ' 1:00 am', '     TivoS4     ', '        South Park       ']
['09/24', 'Fri', ' 5:00 pm', '     TivoS3     ', '         Adam-12         ']
['09/24', 'Fri', ' 5:30 pm', '     TivoS3     ', '     Everyday Edisons    ']
['09/24', 'Fri', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['09/24', 'Fri', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['09/24', 'Fri', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/24', 'Fri', ' 7:30 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/24', 'Fri', ' 8:00 pm', '     TivoS4     ', '        Smallville       ']
['09/24', 'Fri', ' 8:00 pm', '     TivoS4     ', '       Dateline NBC      ']
['09/24', 'Fri', '10:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/24', 'Fri', '10:00 pm', '     TivoS4     ', '          20/20          ']
['09/24', 'Fri', '10:00 pm', '     TivoS4     ', '          Outlaw         ']
['09/24', 'Fri', '11:00 am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/24', 'Fri', '11:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/24', 'Fri', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['09/24', 'Fri', '11:00 pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/24', 'Fri', '11:30 pm', '     TivoS3     ', "      That '70s Show     "]
['09/25', 'Sat', ' 1:00 am', '     TivoS4     ', '        South Park       ']
['09/25', 'Sat', ' 1:01 am', '    DVR 1FA0    ', '        Rescue Me        ']
['09/25', 'Sat', ' 1:30 pm', '     TivoS3     ', "    Woodwright's Shop    "]
['09/25', 'Sat', ' 3:00 pm', '     TivoS3     ', '   New Yankee Workshop   ']
['09/25', 'Sat', ' 3:00 pm', '     TivoS4     ', '         Rawhide         ']
['09/25', 'Sat', ' 4:00 pm', '     TivoS4     ', '         Rawhide         ']
['09/25', 'Sat', ' 5:00 pm', '     TivoS3     ', '    Ask This Old House   ']
['09/25', 'Sat', ' 5:30 pm', '     TivoS3     ', '      This Old House     ']
['09/25', 'Sat', ' 6:00 pm', '     TivoS3     ', '         Hometime        ']
['09/25', 'Sat', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['09/25', 'Sat', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/25', 'Sat', ' 8:00 pm', '     TivoS4     ', '           Cops          ']
['09/25', 'Sat', '10:00 pm', '     TivoS3     ', '     48 Hours Mystery    ']
['09/25', 'Sat', '10:00 pm', '     TivoS4     ', 'Law & Order: Special  ...']
['09/26', 'Sun', ' 2:05 am', '     TivoS4     ', '   Legend of the Seeker  ']
['09/26', 'Sun', ' 4:00 am', '     TivoS3     ', '    Austin City Limits   ']
['09/26', 'Sun', ' 6:30 pm', '     TivoS4     ', '       The Simpsons      ']
['09/26', 'Sun', ' 7:30 pm', '     TivoS4     ', '        60 Minutes       ']
['09/26', 'Sun', ' 8:00 pm', '     TivoS4     ', '       The Simpsons      ']
['09/26', 'Sun', ' 8:30 pm', '     TivoS4     ', '    The Cleveland Show   ']
['09/26', 'Sun', ' 9:00 pm', '     TivoS4     ', '        Family Guy       ']
['09/26', 'Sun', '10:00 pm', '    DVR 1FA0    ', '         The Unit        ']
['09/26', 'Sun', '10:00 pm', '    DVR 1FA0    ', 'Keeping Up With the K ...']
['09/26', 'Sun', '10:30 pm', '     TivoS3     ', "      That '70s Show     "]
['09/26', 'Sun', '10:30 pm', '     TivoS3     ', '    The Red Green Show   ']
['09/26', 'Sun', '11:00 am', '     TivoS3     ', '     Everyday Edisons    ']
['09/26', 'Sun', '11:00 am', '     TivoS3     ', '     McLaughlin Group    ']
['09/26', 'Sun', '11:00 pm', '     TivoS3     ', '         The Unit        ']
['09/26', 'Sun', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['09/26', 'Sun', '11:00 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/26', 'Sun', '11:00 pm', '    DVR 1FA0    ', '         The Unit        ']
['09/26', 'Sun', '11:30 pm', '    DVR 1FA0    ', '        The Reader       ']
['09/27', 'Mon', ' 1:35 am', '     TivoS4     ', '   Legend of the Seeker  ']
['09/27', 'Mon', ' 2:00 am', '     TivoS3     ', '    Austin City Limits   ']
['09/27', 'Mon', ' 2:05 am', '     TivoS4     ', '       Dateline NBC      ']
['09/27', 'Mon', ' 3:00 pm', '    DVR 1FA0    ', '    Muscle Car Workout   ']
['09/27', 'Mon', ' 5:00 pm', '     TivoS3     ', '         Adam-12         ']
['09/27', 'Mon', ' 5:30 pm', '     TivoS3     ', '     Everyday Edisons    ']
['09/27', 'Mon', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['09/27', 'Mon', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['09/27', 'Mon', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/27', 'Mon', ' 7:30 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/27', 'Mon', ' 8:00 pm', '    DVR 1FA0    ', '          Chuck          ']
['09/27', 'Mon', ' 9:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/27', 'Mon', ' 9:00 pm', '     TivoS4     ', '        The Event        ']
['09/27', 'Mon', ' 9:00 pm', '    DVR 1FA0    ', '        The Event        ']
['09/27', 'Mon', '10:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/27', 'Mon', '10:00 pm', '     TivoS3     ', '    Ask This Old House   ']
['09/27', 'Mon', '10:00 pm', '     TivoS4     ', '          Chase          ']
['09/27', 'Mon', '10:30 pm', '     TivoS3     ', '         Hometime        ']
['09/27', 'Mon', '11:00 am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/27', 'Mon', '11:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/27', 'Mon', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['09/27', 'Mon', '11:00 pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/27', 'Mon', '11:30 pm', '     TivoS3     ', "      That '70s Show     "]
['09/27', 'Mon', '12:00 am', '     TivoS4     ', '  Alfred Hitchcock Hour  ']
['09/28', 'Tue', ' 1:00 am', '     TivoS4     ', '        South Park       ']
['09/28', 'Tue', ' 5:00 pm', '     TivoS3     ', '         Adam-12         ']
['09/28', 'Tue', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['09/28', 'Tue', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['09/28', 'Tue', ' 8:00 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/28', 'Tue', ' 9:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/28', 'Tue', '10:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/28', 'Tue', '10:00 pm', '     TivoS3     ', '      This Old House     ']
['09/28', 'Tue', '10:30 pm', '     TivoS3     ', '   New Yankee Workshop   ']
['09/28', 'Tue', '11:00 am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/28', 'Tue', '11:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/28', 'Tue', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['09/28', 'Tue', '11:00 pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/28', 'Tue', '11:30 pm', '     TivoS3     ', "      That '70s Show     "]
['09/28', 'Tue', '12:00 am', '     TivoS3     ', '      Criminal Minds     ']
['09/29', 'Wed', ' 1:00 am', '     TivoS4     ', '        South Park       ']
['09/29', 'Wed', ' 5:00 pm', '     TivoS3     ', '         Adam-12         ']
['09/29', 'Wed', ' 5:30 pm', '     TivoS3     ', '     Everyday Edisons    ']
['09/29', 'Wed', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['09/29', 'Wed', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['09/29', 'Wed', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/29', 'Wed', ' 7:30 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/29', 'Wed', ' 8:00 pm', '     TivoS3     ', "      Hell's Kitchen     "]
['09/29', 'Wed', ' 8:00 pm', '     TivoS4     ', '        The Middle       ']
['09/29', 'Wed', ' 9:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/29', 'Wed', ' 9:00 pm', '     TivoS4     ', 'Law & Order: Special  ...']
['09/29', 'Wed', ' 9:00 pm', '    DVR 1FA0    ', '         The Unit        ']
['09/29', 'Wed', ' 9:31 pm', '     TivoS4     ', '       Cougar Town       ']
['09/29', 'Wed', '10:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/29', 'Wed', '10:00 pm', '     TivoS3     ', '     The Whole Truth     ']
['09/29', 'Wed', '10:00 pm', '     TivoS4     ', '     The Whole Truth     ']
['09/29', 'Wed', '10:00 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/29', 'Wed', '10:00 pm', '    DVR 1FA0    ', '      The Defenders      ']
['09/29', 'Wed', '11:00 am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/29', 'Wed', '11:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/29', 'Wed', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['09/29', 'Wed', '11:00 pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/29', 'Wed', '11:30 pm', '     TivoS3     ', "      That '70s Show     "]
['09/29', 'Wed', '12:00 am', '     TivoS3     ', '      Criminal Minds     ']
['09/30', 'Thu', ' 1:00 am', '     TivoS4     ', '        South Park       ']
['09/30', 'Thu', ' 5:00 pm', '     TivoS3     ', '         Adam-12         ']
['09/30', 'Thu', ' 5:30 pm', '     TivoS3     ', '     Everyday Edisons    ']
['09/30', 'Thu', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['09/30', 'Thu', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['09/30', 'Thu', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/30', 'Thu', ' 7:30 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/30', 'Thu', ' 8:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/30', 'Thu', ' 8:00 pm', '     TivoS3     ', '     Nova scienceNOW     ']
['09/30', 'Thu', ' 8:00 pm', '     TivoS4     ', '        Community        ']
['09/30', 'Thu', ' 8:00 pm', '    DVR 1FA0    ', '   The Big Bang Theory   ']
['09/30', 'Thu', ' 8:30 pm', '     TivoS4     ', '         30 Rock         ']
['09/30', 'Thu', ' 9:00 pm', '     TivoS3     ', '           NOVA          ']
['09/30', 'Thu', ' 9:00 pm', '     TivoS3     ', 'CSI: Crime Scene Inve ...']
['09/30', 'Thu', ' 9:00 pm', '     TivoS4     ', '          Nikita         ']
['09/30', 'Thu', ' 9:00 pm', '     TivoS4     ', '        The Office       ']
['09/30', 'Thu', ' 9:00 pm', '    DVR 1FA0    ', 'The Real Housewives o ...']
['09/30', 'Thu', '10:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/30', 'Thu', '10:30 am', '     TivoS4     ', "Art Wolfe's Travels t ..."]
['09/30', 'Thu', '11:00 am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/30', 'Thu', '11:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['09/30', 'Thu', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['09/30', 'Thu', '11:00 pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/30', 'Thu', '11:30 pm', '     TivoS3     ', "      That '70s Show     "]
['10/01', 'Fri', ' 1:00 am', '     TivoS4     ', '        South Park       ']
['10/01', 'Fri', ' 5:00 pm', '     TivoS3     ', '         Adam-12         ']
['10/01', 'Fri', ' 5:30 pm', '     TivoS3     ', '     Everyday Edisons    ']
['10/01', 'Fri', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['10/01', 'Fri', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['10/01', 'Fri', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['10/01', 'Fri', ' 7:30 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/01', 'Fri', ' 8:00 pm', '     TivoS4     ', '        Smallville       ']
['10/01', 'Fri', ' 8:00 pm', '     TivoS4     ', '       Dateline NBC      ']
['10/01', 'Fri', '10:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['10/01', 'Fri', '10:00 pm', '     TivoS4     ', '          20/20          ']
['10/01', 'Fri', '10:00 pm', '     TivoS4     ', '          Outlaw         ']
['10/01', 'Fri', '11:00 am', '     TivoS4     ', 'Star Trek: The Next G ...']
['10/01', 'Fri', '11:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['10/01', 'Fri', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['10/01', 'Fri', '11:30 pm', '     TivoS3     ', "      That '70s Show     "]
['10/02', 'Sat', ' 1:00 am', '     TivoS4     ', '        South Park       ']
['10/02', 'Sat', ' 1:00 am', '    DVR 1FA0    ', '        Rescue Me        ']
['10/02', 'Sat', ' 1:30 pm', '     TivoS3     ', "    Woodwright's Shop    "]
['10/02', 'Sat', ' 3:00 pm', '     TivoS3     ', '   New Yankee Workshop   ']
['10/02', 'Sat', ' 3:00 pm', '     TivoS4     ', '         Rawhide         ']
['10/02', 'Sat', ' 4:00 pm', '     TivoS4     ', '         Rawhide         ']
['10/02', 'Sat', ' 5:00 pm', '     TivoS3     ', '    Ask This Old House   ']
['10/02', 'Sat', ' 6:00 pm', '     TivoS3     ', '         Hometime        ']
['10/02', 'Sat', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['10/02', 'Sat', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['10/02', 'Sat', ' 8:00 pm', '     TivoS4     ', '           Cops          ']
['10/02', 'Sat', '10:00 pm', '     TivoS4     ', 'Law & Order: Special  ...']
['10/02', 'Sat', '12:00 am', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['10/03', 'Sun', ' 2:05 am', '     TivoS4     ', '   Legend of the Seeker  ']
['10/03', 'Sun', ' 7:00 pm', '     TivoS4     ', '        60 Minutes       ']
['10/03', 'Sun', ' 8:00 pm', '     TivoS4     ', '       The Simpsons      ']
['10/03', 'Sun', ' 8:30 pm', '     TivoS4     ', '    The Cleveland Show   ']
['10/03', 'Sun', ' 9:00 pm', '     TivoS4     ', '        Family Guy       ']
['10/03', 'Sun', ' 9:30 pm', '     TivoS4     ', '       American Dad      ']
['10/03', 'Sun', '10:00 pm', '    DVR 1FA0    ', '         The Unit        ']
['10/03', 'Sun', '10:00 pm', '    DVR 1FA0    ', 'Keeping Up With the K ...']
['10/03', 'Sun', '10:30 pm', '     TivoS3     ', "      That '70s Show     "]
['10/03', 'Sun', '10:30 pm', '     TivoS3     ', '    The Red Green Show   ']
['10/03', 'Sun', '11:00 am', '     TivoS3     ', '     Everyday Edisons    ']
['10/03', 'Sun', '11:00 am', '     TivoS3     ', '     McLaughlin Group    ']
['10/03', 'Sun', '11:00 pm', '     TivoS3     ', '         The Unit        ']
['10/03', 'Sun', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['10/03', 'Sun', '11:00 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/03', 'Sun', '12:30 pm', '    DVR 1FA0    ', '     Two Guys Garage     ']
['10/04', 'Mon', ' 2:00 am', '     TivoS3     ', '    Austin City Limits   ']
['10/04', 'Mon', ' 3:00 pm', '    DVR 1FA0    ', '    Muscle Car Workout   ']
['10/04', 'Mon', ' 3:03 am', '     TivoS4     ', '       Dateline NBC      ']
['10/04', 'Mon', ' 5:00 pm', '     TivoS3     ', '         Adam-12         ']
['10/04', 'Mon', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['10/04', 'Mon', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['10/04', 'Mon', ' 7:00 pm', '     TivoS4     ', '    Petticoat Junction   ']
['10/04', 'Mon', ' 7:30 pm', '     TivoS4     ', '       The Simpsons      ']
['10/04', 'Mon', ' 7:30 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/04', 'Mon', ' 8:00 pm', '    DVR 1FA0    ', '          Chuck          ']
['10/04', 'Mon', ' 9:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['10/04', 'Mon', ' 9:00 pm', '     TivoS4     ', '        The Event        ']
['10/04', 'Mon', ' 9:00 pm', '    DVR 1FA0    ', '        The Event        ']
['10/04', 'Mon', '10:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['10/04', 'Mon', '10:00 pm', '     TivoS3     ', '    Ask This Old House   ']
['10/04', 'Mon', '10:00 pm', '     TivoS4     ', '          Chase          ']
['10/04', 'Mon', '10:30 pm', '     TivoS3     ', '         Hometime        ']
['10/04', 'Mon', '11:00 am', '     TivoS4     ', 'Star Trek: The Next G ...']
['10/04', 'Mon', '11:00 pm', '     TivoS3     ', '      Criminal Minds     ']
['10/04', 'Mon', '11:00 pm', '     TivoS3     ', "      That '70s Show     "]
['10/04', 'Mon', '11:30 pm', '     TivoS3     ', "      That '70s Show     "]
['10/05', 'Tue', ' 1:00 am', '     TivoS4     ', '        South Park       ']
['10/05', 'Tue', ' 3:00 pm', '    DVR 1FA0    ', '    Muscle Car Workout   ']
['10/05', 'Tue', ' 5:00 pm', '     TivoS3     ', '         Adam-12         ']
['10/05', 'Tue', ' 6:00 pm', '     TivoS3     ', '        Emergency!       ']
['10/05', 'Tue', ' 7:00 pm', '     TivoS4     ', '        Jeopardy!        ']
['10/05', 'Tue', ' 7:30 pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/05', 'Tue', '11:00 am', '     TivoS4     ', 'Star Trek: The Next G ...']
['10/05', 'Tue', '12:00 am', '     TivoS3     ', '      Criminal Minds     ']
['10/05', 'Tue', '12:00 am', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
Press Enter

 9:49:49>

There is more I'd like to do with it, such as breaking out the individual dvr's items into their own list for comparison, but I'm happy just getting the data!

Note: This is a whole _account_ list, not just a whole house list. 'DVR 1FA0' is a TiVo's name at my sister's house, one that I've been bugging them to get off my account and onto their own now for awhile! I don't really watch "Keeping up with..." or "Real Housewives of..."


----------



## orangeboy

Ok, here's what I have come up with. It doesn't closely abide to PEP-8, and there's a LOT of duplicate code in the last chunk of logic. I'll chalk that up to python newbness. I have second copy that is a bit more verbose, printing certain events such as logging in, and which TiVo's ToDo List it's working on, but the following returns the data in two ways, first as a "condensed" list, showing date, time, TiVo and show, then as an expanded "per day" view, showing the date, then the hours of the day (incremented by 30 minutes) and any TiVos that have something scheduled within that 30 minutes. At this time, I don't have any show information other than the show title. Having a show's duration would be very useful, using that to determine how long a tuner would be tied up. This code assumes 30 minute show durations only. I'm pretty sure the information is at TiVo, so an enhancement may come along if this is well received.

Once again, a TiVoToDo.conf file containing tivo.com login information is required to be in the same folder as the TiVoToDo.py file (see previous post).



Code:


#!/usr/bin/python
#TiVoToDo.py

import sys
import os.path
import urllib
import urllib2
import operator
import cookielib
import ConfigParser

from time import sleep
from HTMLParser import HTMLParser
from collections import defaultdict

p = os.path.dirname(__file__)
config = ConfigParser.ConfigParser()
config_files = ['/etc/TiVoToDo.conf', os.path.join(p, 'TiVoToDo.conf')]
configs_found = config.read(config_files)

if not configs_found:
    print ('ERROR: TiVoToDo.conf does not exist.\n' +
           'You must create this file before running TiVoToDo.')
    sys.exit(1)
config.read(config_files)

if not config.has_section('email'):
    print 'TiVo account email required in TiVoToDo.conf'
    sys.exit(1)
email = config.get('email', 'email')

if not config.has_section('password'):
    print 'TiVo account password required in TiVoToDo.conf'
    sys.exit(1)
password = config.get('password', 'password')

tdl = []
ord_tdl = []
header = {'User-agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}
base_url = 'https://www3.tivo.com'
todo_url = '/tivo-tco/go.do?def=tco.todo.page'
npl_url = '/tivo-tco/go.do?def=tco.nowplaying.page'

def hour_table(table):
    table = []
    for h in range(0, 24):
        per = 'am'
        if h < 1:
            hrs = '12'
        if h >= 1:
            hrs = str(h).rjust(2,' ')
        if h > 11:
            per = 'pm'
        if h > 12:
            hrs = str(h - 12).rjust(2,' ')
        table.append(hrs + ':00')
        table.append(per)
        table.append(hrs + ':30')
        table.append(per)
    return table

cookiefile = 'cookies.lwp'
urlopen = urllib2.urlopen
Request = urllib2.Request
cj      = cookielib.LWPCookieJar()

if os.path.isfile(cookiefile):
    cj.load(cookiefile)

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)

class TagParser(HTMLParser):
    tdl = []
    tsns = []
    tivos = []
    current_tivo = None
    noShows = False
    def __init__(self):
        HTMLParser.__init__(self)
        self.a_flag = False
        self.a_data = ''
        self.get_data = False
        self.option_flag = False
        self.select_flag = False
        self.span_count = 0
        self.span_flag = False
        self.span_tags = ['day', 'date', 'time']

    def handle_starttag(self, tag, attrs):
        if tag == 'a' and page != 'NPL' and attrs != []:
            if attrs[0][1] == 'trigger':
                self.a_flag = True
                self.get_data = True

        if tag == 'div' and page != 'NPL' and attrs != []:
            if attrs[0][1] == 'noShows':
                TagParser.noShows = True

        if tag == 'option' and self.select_flag and \
           attrs[0][0] =='value' and page == 'NPL':
            self.option_flag = True
            self.get_data = True
            TagParser.tsns.append(attrs[0][1])

        if tag == 'select' and attrs[0][1] == 'DVRlist':
            self.select_flag = True

        if tag == 'span' and attrs[0][1] in self.span_tags and page != 'NPL':
            self.span_flag = True
            self.get_data = True
            self.span_count += 1

    def handle_data(self, data):
        if self.get_data:
            if self.span_flag:
                TagParser.tdl.append(data)

            if self.a_flag:
                self.a_data = self.a_data + data

            if self.option_flag:
                TagParser.tivos.append(data)

    def handle_endtag(self, tag):
        if tag == 'a' and self.a_flag:
            TagParser.tdl.append(self.a_data.rstrip('\n '))
            TagParser.tdl.append(TagParser.current_tivo)
            self.a_data = ''
            self.a_flag = False
        self.get_data = False
        self.span_flag = False
        self.option_flag = False
        if tag == 'select':
            self.select_flag = False

parser  = TagParser()

def login(target_url, email, password):
    url = target_url + '/tivo-tco/login.do'
    login_data = urllib.urlencode({
        'cams_cb_partner': None,
        'cams_security_domain': 'tivocom',
        'cams_login_config': 'http',
        'cams_original_url': npl_url,
        'cams_cb_username': email,
        'cams_cb_password': password,
        'remember_email': 'true',
        'cams_cb_rememberme': 'true'
    })
    return url, login_data

def request_url(url, data=None, header=header):
    if data is None:
        data = None
    try:
        req = Request(url, data, header)
        handle = urlopen(req)
    except IOError, e:
        print 'We failed to open "&#37;s".' % url
        if hasattr(e, 'code'):
            print 'We failed with error code - %s.' % e.code
            exit()
    else:
        result = handle.read()
        parser.feed(result)
        parser.close()
        parser.reset()

def isHDtivo(tsn):  # tsn's of High Definition Tivo's
    return bool(tsn and tsn[0] >= '6' and tsn[:3] != '649')

page = 'NPL'
url, login_data = login(base_url, email, password)
request_url(url, login_data, header)

tivos = dict(zip(parser.tivos, parser.tsns))

def sort_table(table, cols):
    """ sort a table by multiple columns
        table: a list of lists (or tuple of tuples) where each inner list
               represents a row
        cols:  a list (or tuple) specifying the column numbers to sort by
               e.g. (1,0) would sort by column 1, then by column 0
    """
    for col in reversed(cols):
        table = sorted(table, key=operator.itemgetter(col))
    return table

for tivo, tsn in tivos.iteritems():
    TagParser.noShows = False
    if isHDtivo(tsn):
        TagParser.current_tivo = tivo
        page = 'ToDo'
        offset = 0

        while not TagParser.noShows:
            url = base_url + todo_url + '&tsn=' + tsn + '&offset=%d' % offset
            offset += 20
            login_data = None
            request_url(url, login_data, header)
            sleep(1)

raw_tdl = parser.tdl

for i in range(5, len(raw_tdl), 5):
    nl = raw_tdl[i-5:i]
    a = nl[1].partition('/')
    a = a[0].rjust(2,'0') + a[1] + a[2].rjust(2,'0')
    b = nl[2].rjust(8)[:5]
    c = nl[2][-2:]
    ord_tdl.append([a, nl[0], b, c, nl[4].center(16), nl[3].center(25)])

for row in sort_table(ord_tdl, (0, 3, 2, 4)):
    tdl.append(row)

for i in range(len(tdl)):
    if i != len(tdl) - 1:
        if tdl[i - 1][:1] != tdl[i][:1]:
            print
    print tdl[i]

print
x = raw_input("Press Enter when ready to see dates.")
print

hp = []
hp = hour_table(hp)
fnd_list = hp
fnd_tivos = ''

for a in range(len(tdl)):
    tdl_row = tdl[a]
    tdl_end = len(tdl) - 1
    tdl_date = tdl_row[0]
    tdl_wday = tdl_row[1]
    tdl_time = tdl_row[2]
    tdl_per  = tdl_row[3]
    tdl_tivo = tdl_row[4]
    tdl_show = tdl_row[5]
    if a != tdl_end:
        tdl_nrow = tdl[a + 1]
        tdl_nper = tdl_nrow[3]
        tdl_ndate = tdl_nrow[0]
        tdl_ntime = tdl_nrow[2]
        if tdl_date == tdl_ndate:
            for b in range(0, len(hp), 2):
                hp_end = len(hp) - 2
                hp_time  = hp[b]
                hp_per   = hp[b + 1]
                if b != hp_end:
                    hp_ntime = hp[b + 2]
                    hp_nper  = hp[b + 3]
                    if tdl_time >= hp_time and tdl_time < hp_ntime and tdl_per == hp_per:
                        if tdl_ntime >= hp_time and tdl_ntime < hp_ntime and tdl_nper == hp_per:
                            fnd_tivos = fnd_tivos + ' [' + tdl_tivo + ']'
                        else:
                            fnd_tivos = hp_time + ' ' + hp_per + fnd_tivos + ' [' + tdl_tivo + ']'
                            fnd_list.pop(b)
                            fnd_list.insert(b, fnd_tivos)
                            fnd_tivos = ''
                else:
                    if tdl_time >= hp_time and tdl_per == hp_per:
                        fnd_tivos = hp_time + ' ' + hp_per + fnd_tivos + ' [' + tdl_tivo + ']'
                        fnd_list.pop(b)
                        fnd_list.insert(b, fnd_tivos)
                        fnd_tivos = ''
        else:
            for b in range(0, len(hp), 2):
                hp_end = len(hp) - 2
                hp_time  = hp[b]
                hp_per   = hp[b + 1]
                if b != hp_end:
                    hp_ntime = hp[b + 2]
                    hp_nper  = hp[b + 3]
                    if tdl_time >= hp_time and tdl_time < hp_ntime and tdl_per == hp_per:
                        if tdl_ntime >= hp_time and tdl_ntime < hp_ntime and tdl_nper == hp_per:
                            fnd_tivos = fnd_tivos + ' [' + tdl_tivo + ']'
                        else:
                            fnd_tivos = hp_time + ' ' + hp_per + fnd_tivos + ' [' + tdl_tivo + ']'
                            fnd_list.pop(b)
                            fnd_list.insert(b, fnd_tivos)
                            fnd_tivos = ''
                else:
                    if tdl_time >= hp_time and tdl_per == hp_per:
                        fnd_tivos = hp_time + ' ' + hp_per + fnd_tivos + ' [' + tdl_tivo + ']'
                        fnd_list.pop(b)
                        fnd_list.insert(b, fnd_tivos)
                        fnd_tivos = ''
            print tdl_wday + ', ' + tdl_date
            for b in range(0, len(fnd_list), 2):
                if len(fnd_list[b]) == 5:
                    fnd_list[b] = fnd_list[b] + ' ' + fnd_list[b + 1]
                if b == 48:
                    print
                print fnd_list[b]
            hp = hour_table(hp)
            fnd_list = []
            fnd_list = hp
            fnd_tivos = ''
            print
            x = raw_input("Press Enter to see the next date.")
            print
    else:
        print tdl_wday + ', ' + tdl_date
        for b in range(0, len(hp), 2):
            hp_end = len(hp) - 2
            hp_time  = hp[b]
            hp_per   = hp[b + 1]
            if b != hp_end:
                hp_ntime = hp[b + 2]
                hp_nper  = hp[b + 3]
                if tdl_time >= hp_time and tdl_time < hp_ntime and tdl_per == hp_per:
                    fnd_tivos = hp_time + ' ' + hp_per + fnd_tivos + ' [' + tdl_tivo + ']'
                    fnd_list.pop(b)
                    fnd_list.insert(b, fnd_tivos)
                    fnd_tivos = ''
            else:
                if tdl_time >= hp_time and tdl_per == hp_per:
                    fnd_tivos = hp_time + ' ' + hp_per + fnd_tivos + ' [' + tdl_tivo + ']'
                    fnd_list.pop(b)
                    fnd_list.insert(b, fnd_tivos)
                    fnd_tivos = ''
        for b in range(0, len(fnd_list), 2):
            if len(fnd_list[b]) == 5:
                fnd_list[b] = fnd_list[b] + ' ' + fnd_list[b + 1]
            if b == 48:
                print
            print fnd_list[b]

print
for tivo, tsn in tivos.iteritems():
    if isHDtivo(tsn):
        print tivo.ljust(8), 'has %3d recodings scheduled' % raw_tdl.count(tivo)

print

x = raw_input("Press Enter to exit")
exit ()

And the result:


Code:


14:28:36>TiVoToDo.py

['09/25', 'Sat', ' 1:30', 'pm', '     TivoS3     ', "    Woodwright's Shop    "]
['09/25', 'Sat', ' 3:00', 'pm', '     TivoS3     ', '   New Yankee Workshop   ']
['09/25', 'Sat', ' 3:00', 'pm', '     TivoS4     ', '         Rawhide         ']
['09/25', 'Sat', ' 4:00', 'pm', '     TivoS4     ', '         Rawhide         ']
['09/25', 'Sat', ' 5:00', 'pm', '     TivoS3     ', '    Ask This Old House   ']
['09/25', 'Sat', ' 5:30', 'pm', '     TivoS3     ', '      This Old House     ']
['09/25', 'Sat', ' 6:00', 'pm', '     TivoS3     ', '         Hometime        ']
['09/25', 'Sat', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['09/25', 'Sat', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/25', 'Sat', ' 8:00', 'pm', '     TivoS4     ', '           Cops          ']
['09/25', 'Sat', '10:00', 'pm', '     TivoS3     ', '     48 Hours Mystery    ']
['09/25', 'Sat', '10:00', 'pm', '     TivoS4     ', 'Law & Order: Special  ...']

['09/26', 'Sun', ' 2:05', 'am', '     TivoS4     ', '   Legend of the Seeker  ']
['09/26', 'Sun', ' 4:00', 'am', '     TivoS3     ', '    Austin City Limits   ']
['09/26', 'Sun', '11:00', 'am', '     TivoS3     ', '     Everyday Edisons    ']
['09/26', 'Sun', '11:00', 'am', '     TivoS3     ', '     McLaughlin Group    ']
['09/26', 'Sun', ' 6:30', 'pm', '     TivoS4     ', '       The Simpsons      ']
['09/26', 'Sun', ' 7:30', 'pm', '     TivoS4     ', '        60 Minutes       ']
['09/26', 'Sun', ' 8:00', 'pm', '     TivoS4     ', '       The Simpsons      ']
['09/26', 'Sun', ' 8:30', 'pm', '     TivoS4     ', '    The Cleveland Show   ']
['09/26', 'Sun', ' 9:00', 'pm', '     TivoS4     ', '        Family Guy       ']
['09/26', 'Sun', '10:00', 'pm', '    DVR 1FA0    ', '         The Unit        ']
['09/26', 'Sun', '10:00', 'pm', '    DVR 1FA0    ', 'Keeping Up With the K ...']
['09/26', 'Sun', '10:30', 'pm', '     TivoS3     ', '    The Red Green Show   ']
['09/26', 'Sun', '10:30', 'pm', '     TivoS3     ', "      That '70s Show     "]
['09/26', 'Sun', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['09/26', 'Sun', '11:00', 'pm', '     TivoS3     ', '         The Unit        ']
['09/26', 'Sun', '11:00', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/26', 'Sun', '11:00', 'pm', '    DVR 1FA0    ', '         The Unit        ']
['09/26', 'Sun', '11:30', 'pm', '    DVR 1FA0    ', '        The Reader       ']

['09/27', 'Mon', ' 1:35', 'am', '     TivoS4     ', '   Legend of the Seeker  ']
['09/27', 'Mon', ' 2:00', 'am', '     TivoS3     ', '    Austin City Limits   ']
['09/27', 'Mon', ' 2:05', 'am', '     TivoS4     ', '       Dateline NBC      ']
['09/27', 'Mon', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/27', 'Mon', '12:00', 'am', '     TivoS4     ', '  Alfred Hitchcock Hour  ']
['09/27', 'Mon', ' 3:00', 'pm', '    DVR 1FA0    ', '    Muscle Car Workout   ']
['09/27', 'Mon', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['09/27', 'Mon', ' 5:30', 'pm', '     TivoS3     ', '     Everyday Edisons    ']
['09/27', 'Mon', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['09/27', 'Mon', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['09/27', 'Mon', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/27', 'Mon', ' 7:30', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/27', 'Mon', ' 8:00', 'pm', '    DVR 1FA0    ', '          Chuck          ']
['09/27', 'Mon', ' 9:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/27', 'Mon', ' 9:00', 'pm', '     TivoS4     ', '        The Event        ']
['09/27', 'Mon', ' 9:00', 'pm', '    DVR 1FA0    ', '        The Event        ']
['09/27', 'Mon', '10:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/27', 'Mon', '10:00', 'pm', '     TivoS3     ', '    Ask This Old House   ']
['09/27', 'Mon', '10:00', 'pm', '     TivoS4     ', '          Chase          ']
['09/27', 'Mon', '10:30', 'pm', '     TivoS3     ', '         Hometime        ']
['09/27', 'Mon', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['09/27', 'Mon', '11:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/27', 'Mon', '11:00', 'pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/27', 'Mon', '11:30', 'pm', '     TivoS3     ', "      That '70s Show     "]

['09/28', 'Tue', ' 1:00', 'am', '     TivoS4     ', '        South Park       ']
['09/28', 'Tue', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/28', 'Tue', '12:00', 'am', '     TivoS3     ', '      Criminal Minds     ']
['09/28', 'Tue', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['09/28', 'Tue', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['09/28', 'Tue', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['09/28', 'Tue', ' 8:00', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/28', 'Tue', ' 9:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/28', 'Tue', '10:00', 'pm', '     TivoS3     ', '      This Old House     ']
['09/28', 'Tue', '10:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/28', 'Tue', '10:30', 'pm', '     TivoS3     ', '   New Yankee Workshop   ']
['09/28', 'Tue', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['09/28', 'Tue', '11:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/28', 'Tue', '11:00', 'pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/28', 'Tue', '11:30', 'pm', '     TivoS3     ', "      That '70s Show     "]

['09/29', 'Wed', ' 1:00', 'am', '     TivoS4     ', '        South Park       ']
['09/29', 'Wed', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/29', 'Wed', '12:00', 'am', '     TivoS3     ', '      Criminal Minds     ']
['09/29', 'Wed', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['09/29', 'Wed', ' 5:30', 'pm', '     TivoS3     ', '     Everyday Edisons    ']
['09/29', 'Wed', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['09/29', 'Wed', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['09/29', 'Wed', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/29', 'Wed', ' 7:30', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/29', 'Wed', ' 8:00', 'pm', '     TivoS3     ', "      Hell's Kitchen     "]
['09/29', 'Wed', ' 8:00', 'pm', '     TivoS4     ', '        The Middle       ']
['09/29', 'Wed', ' 9:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/29', 'Wed', ' 9:00', 'pm', '     TivoS4     ', 'Law & Order: Special  ...']
['09/29', 'Wed', ' 9:00', 'pm', '    DVR 1FA0    ', '         The Unit        ']
['09/29', 'Wed', ' 9:31', 'pm', '     TivoS4     ', '       Cougar Town       ']
['09/29', 'Wed', '10:00', 'pm', '     TivoS3     ', '     The Whole Truth     ']
['09/29', 'Wed', '10:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/29', 'Wed', '10:00', 'pm', '     TivoS4     ', '     The Whole Truth     ']
['09/29', 'Wed', '10:00', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/29', 'Wed', '10:00', 'pm', '    DVR 1FA0    ', '      The Defenders      ']
['09/29', 'Wed', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['09/29', 'Wed', '11:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/29', 'Wed', '11:00', 'pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/29', 'Wed', '11:30', 'pm', '     TivoS3     ', "      That '70s Show     "]

['09/30', 'Thu', ' 1:00', 'am', '     TivoS4     ', '        South Park       ']
['09/30', 'Thu', '10:30', 'am', '     TivoS4     ', "Art Wolfe's Travels t ..."]
['09/30', 'Thu', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['09/30', 'Thu', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['09/30', 'Thu', ' 5:30', 'pm', '     TivoS3     ', '     Everyday Edisons    ']
['09/30', 'Thu', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['09/30', 'Thu', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['09/30', 'Thu', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['09/30', 'Thu', ' 7:30', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['09/30', 'Thu', ' 8:00', 'pm', '     TivoS3     ', '     Nova scienceNOW     ']
['09/30', 'Thu', ' 8:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/30', 'Thu', ' 8:00', 'pm', '     TivoS4     ', '        Community        ']
['09/30', 'Thu', ' 8:00', 'pm', '    DVR 1FA0    ', '   The Big Bang Theory   ']
['09/30', 'Thu', ' 8:30', 'pm', '     TivoS4     ', '         30 Rock         ']
['09/30', 'Thu', ' 9:00', 'pm', '     TivoS3     ', 'CSI: Crime Scene Inve ...']
['09/30', 'Thu', ' 9:00', 'pm', '     TivoS3     ', '           NOVA          ']
['09/30', 'Thu', ' 9:00', 'pm', '     TivoS4     ', '        The Office       ']
['09/30', 'Thu', ' 9:00', 'pm', '     TivoS4     ', '          Nikita         ']
['09/30', 'Thu', ' 9:00', 'pm', '    DVR 1FA0    ', 'The Real Housewives o ...']
['09/30', 'Thu', '10:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/30', 'Thu', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['09/30', 'Thu', '11:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['09/30', 'Thu', '11:00', 'pm', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['09/30', 'Thu', '11:30', 'pm', '     TivoS3     ', "      That '70s Show     "]

['10/01', 'Fri', ' 1:00', 'am', '     TivoS4     ', '        South Park       ']
['10/01', 'Fri', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['10/01', 'Fri', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['10/01', 'Fri', ' 5:30', 'pm', '     TivoS3     ', '     Everyday Edisons    ']
['10/01', 'Fri', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['10/01', 'Fri', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['10/01', 'Fri', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['10/01', 'Fri', ' 7:30', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/01', 'Fri', ' 8:00', 'pm', '     TivoS4     ', '       Dateline NBC      ']
['10/01', 'Fri', ' 8:00', 'pm', '     TivoS4     ', '        Smallville       ']
['10/01', 'Fri', '10:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/01', 'Fri', '10:00', 'pm', '     TivoS4     ', '          Outlaw         ']
['10/01', 'Fri', '10:00', 'pm', '     TivoS4     ', '          20/20          ']
['10/01', 'Fri', '11:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/01', 'Fri', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['10/01', 'Fri', '11:30', 'pm', '     TivoS3     ', "      That '70s Show     "]

['10/02', 'Sat', ' 1:00', 'am', '     TivoS4     ', '        South Park       ']
['10/02', 'Sat', ' 1:01', 'am', '    DVR 1FA0    ', '        Rescue Me        ']
['10/02', 'Sat', '12:00', 'am', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['10/02', 'Sat', ' 1:30', 'pm', '     TivoS3     ', "    Woodwright's Shop    "]
['10/02', 'Sat', ' 3:00', 'pm', '     TivoS3     ', '   New Yankee Workshop   ']
['10/02', 'Sat', ' 3:00', 'pm', '     TivoS4     ', '         Rawhide         ']
['10/02', 'Sat', ' 4:00', 'pm', '     TivoS4     ', '         Rawhide         ']
['10/02', 'Sat', ' 5:00', 'pm', '     TivoS3     ', '    Ask This Old House   ']
['10/02', 'Sat', ' 6:00', 'pm', '     TivoS3     ', '         Hometime        ']
['10/02', 'Sat', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['10/02', 'Sat', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['10/02', 'Sat', ' 8:00', 'pm', '     TivoS4     ', '           Cops          ']
['10/02', 'Sat', '10:00', 'pm', '     TivoS4     ', 'Law & Order: Special  ...']

['10/03', 'Sun', ' 2:05', 'am', '     TivoS4     ', '   Legend of the Seeker  ']
['10/03', 'Sun', '11:00', 'am', '     TivoS3     ', '     McLaughlin Group    ']
['10/03', 'Sun', '11:00', 'am', '     TivoS3     ', '     Everyday Edisons    ']
['10/03', 'Sun', ' 7:00', 'pm', '     TivoS4     ', '        60 Minutes       ']
['10/03', 'Sun', ' 8:00', 'pm', '     TivoS4     ', '       The Simpsons      ']
['10/03', 'Sun', ' 8:30', 'pm', '     TivoS4     ', '    The Cleveland Show   ']
['10/03', 'Sun', ' 9:00', 'pm', '     TivoS4     ', '        Family Guy       ']
['10/03', 'Sun', ' 9:30', 'pm', '     TivoS4     ', '       American Dad      ']
['10/03', 'Sun', '10:00', 'pm', '     TivoS3     ', '         The Unit        ']
['10/03', 'Sun', '10:00', 'pm', '    DVR 1FA0    ', '         The Unit        ']
['10/03', 'Sun', '10:00', 'pm', '    DVR 1FA0    ', 'Keeping Up With the K ...']
['10/03', 'Sun', '10:30', 'pm', '     TivoS3     ', "      That '70s Show     "]
['10/03', 'Sun', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['10/03', 'Sun', '11:00', 'pm', '     TivoS3     ', '         The Unit        ']
['10/03', 'Sun', '11:00', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/03', 'Sun', '12:30', 'pm', '    DVR 1FA0    ', '     Two Guys Garage     ']

['10/04', 'Mon', ' 2:00', 'am', '     TivoS3     ', '    Austin City Limits   ']
['10/04', 'Mon', ' 3:03', 'am', '     TivoS4     ', '       Dateline NBC      ']
['10/04', 'Mon', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['10/04', 'Mon', ' 3:00', 'pm', '    DVR 1FA0    ', '    Muscle Car Workout   ']
['10/04', 'Mon', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['10/04', 'Mon', ' 5:30', 'pm', '     TivoS3     ', '     Everyday Edisons    ']
['10/04', 'Mon', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['10/04', 'Mon', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['10/04', 'Mon', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['10/04', 'Mon', ' 7:30', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/04', 'Mon', ' 7:30', 'pm', '     TivoS4     ', '       The Simpsons      ']
['10/04', 'Mon', ' 8:00', 'pm', '    DVR 1FA0    ', '          Chuck          ']
['10/04', 'Mon', ' 9:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/04', 'Mon', ' 9:00', 'pm', '     TivoS4     ', '        The Event        ']
['10/04', 'Mon', ' 9:00', 'pm', '    DVR 1FA0    ', '        The Event        ']
['10/04', 'Mon', '10:00', 'pm', '     TivoS3     ', '    Ask This Old House   ']
['10/04', 'Mon', '10:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/04', 'Mon', '10:00', 'pm', '     TivoS4     ', '          Chase          ']
['10/04', 'Mon', '10:30', 'pm', '     TivoS3     ', '         Hometime        ']
['10/04', 'Mon', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['10/04', 'Mon', '11:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/04', 'Mon', '11:30', 'pm', '     TivoS3     ', "      That '70s Show     "]

['10/05', 'Tue', ' 1:00', 'am', '     TivoS4     ', '        South Park       ']
['10/05', 'Tue', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['10/05', 'Tue', '12:00', 'am', '     TivoS3     ', '      Criminal Minds     ']
['10/05', 'Tue', '12:00', 'am', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['10/05', 'Tue', ' 3:00', 'pm', '    DVR 1FA0    ', '    Muscle Car Workout   ']
['10/05', 'Tue', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['10/05', 'Tue', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['10/05', 'Tue', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['10/05', 'Tue', ' 7:30', 'pm', '     TivoS4     ', '       The Simpsons      ']
['10/05', 'Tue', ' 8:00', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/05', 'Tue', ' 9:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/05', 'Tue', ' 9:00', 'pm', '     TivoS3     ', '    Austin City Limits   ']
['10/05', 'Tue', '10:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/05', 'Tue', '10:30', 'pm', '     TivoS3     ', '   New Yankee Workshop   ']
['10/05', 'Tue', '10:30', 'pm', '    DVR 1FA0    ', '   Chasing Classic Cars  ']
['10/05', 'Tue', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['10/05', 'Tue', '11:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/05', 'Tue', '11:30', 'pm', '     TivoS3     ', "      That '70s Show     "]

['10/06', 'Wed', ' 1:00', 'am', '     TivoS4     ', '        South Park       ']
['10/06', 'Wed', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['10/06', 'Wed', '12:00', 'am', '     TivoS3     ', '      Criminal Minds     ']
['10/06', 'Wed', '12:00', 'am', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['10/06', 'Wed', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['10/06', 'Wed', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['10/06', 'Wed', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['10/06', 'Wed', ' 7:30', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/06', 'Wed', ' 7:30', 'pm', '     TivoS4     ', '       The Simpsons      ']
['10/06', 'Wed', ' 8:00', 'pm', '     TivoS3     ', "      Hell's Kitchen     "]
['10/06', 'Wed', ' 8:00', 'pm', '     TivoS4     ', '        The Middle       ']
['10/06', 'Wed', ' 9:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/06', 'Wed', ' 9:00', 'pm', '     TivoS4     ', 'Law & Order: Special  ...']
['10/06', 'Wed', ' 9:31', 'pm', '     TivoS4     ', '       Cougar Town       ']
['10/06', 'Wed', '10:00', 'pm', '     TivoS3     ', '     The Whole Truth     ']
['10/06', 'Wed', '10:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/06', 'Wed', '10:00', 'pm', '     TivoS4     ', '     The Whole Truth     ']
['10/06', 'Wed', '10:00', 'pm', '     TivoS4     ', '    Muscle Car Workout   ']
['10/06', 'Wed', '11:00', 'pm', '     TivoS3     ', "      That '70s Show     "]
['10/06', 'Wed', '11:00', 'pm', '     TivoS3     ', '      Criminal Minds     ']
['10/06', 'Wed', '11:30', 'pm', '     TivoS3     ', "      That '70s Show     "]

['10/07', 'Thu', ' 1:00', 'am', '     TivoS4     ', '        South Park       ']
['10/07', 'Thu', '10:30', 'am', '     TivoS4     ', "Art Wolfe's Travels t ..."]
['10/07', 'Thu', '11:00', 'am', '     TivoS4     ', 'Star Trek: The Next G ...']
['10/07', 'Thu', '12:00', 'am', '     TivoS4     ', 'Alfred Hitchcock Pres ...']
['10/07', 'Thu', ' 5:00', 'pm', '     TivoS3     ', '         Adam-12         ']
['10/07', 'Thu', ' 5:30', 'pm', '     TivoS3     ', '     Everyday Edisons    ']
['10/07', 'Thu', ' 6:00', 'pm', '     TivoS3     ', '        Emergency!       ']
['10/07', 'Thu', ' 7:00', 'pm', '     TivoS4     ', '        Jeopardy!        ']
['10/07', 'Thu', ' 7:00', 'pm', '     TivoS4     ', '    Petticoat Junction   ']
['10/07', 'Thu', ' 7:30', 'pm', '     TivoS4     ', '       The Simpsons      ']

Press Enter when ready to see dates.

Sat, 09/25
12:00 am
12:30 am
 1:00 am
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm [     TivoS3     ]
 2:00 pm
 2:30 pm
 3:00 pm [     TivoS3     ] [     TivoS4     ]
 3:30 pm
 4:00 pm [     TivoS4     ]
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm [     TivoS3     ]
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ] [     TivoS4     ]
 7:30 pm
 8:00 pm [     TivoS4     ]
 8:30 pm
 9:00 pm
 9:30 pm
10:00 pm [     TivoS3     ] [     TivoS4     ]
10:30 pm
11:00 pm
11:30 pm

Press Enter to see the next date.

Sun, 09/26
12:00 am
12:30 am
 1:00 am
 1:30 am
 2:00 am [     TivoS4     ]
 2:30 am
 3:00 am
 3:30 am
 4:00 am [     TivoS3     ]
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS3     ] [     TivoS3     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm
 5:30 pm
 6:00 pm
 6:30 pm [     TivoS4     ]
 7:00 pm
 7:30 pm [     TivoS4     ]
 8:00 pm [     TivoS4     ]
 8:30 pm [     TivoS4     ]
 9:00 pm [     TivoS4     ]
 9:30 pm
10:00 pm [    DVR 1FA0    ] [    DVR 1FA0    ]
10:30 pm [     TivoS3     ] [     TivoS3     ]
11:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ] [    DVR 1FA0    ]
11:30 pm [    DVR 1FA0    ]

Press Enter to see the next date.

Mon, 09/27
12:00 am [     TivoS4     ]
12:30 am
 1:00 am
 1:30 am [     TivoS4     ]
 2:00 am [     TivoS3     ] [     TivoS4     ]
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm [    DVR 1FA0    ]
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm [     TivoS3     ]
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ] [     TivoS4     ]
 7:30 pm [     TivoS4     ]
 8:00 pm [    DVR 1FA0    ]
 8:30 pm
 9:00 pm [     TivoS3     ] [     TivoS4     ] [    DVR 1FA0    ]
 9:30 pm
10:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ]
10:30 pm [     TivoS3     ]
11:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ]
11:30 pm [     TivoS3     ]

Press Enter to see the next date.

Tue, 09/28
12:00 am [     TivoS3     ]
12:30 am
 1:00 am [     TivoS4     ]
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ]
 7:30 pm
 8:00 pm [     TivoS4     ]
 8:30 pm
 9:00 pm [     TivoS3     ]
 9:30 pm
10:00 pm [     TivoS3     ] [     TivoS3     ]
10:30 pm [     TivoS3     ]
11:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ]
11:30 pm [     TivoS3     ]

Press Enter to see the next date.

Wed, 09/29
12:00 am [     TivoS3     ]
12:30 am
 1:00 am [     TivoS4     ]
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm [     TivoS3     ]
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ] [     TivoS4     ]
 7:30 pm [     TivoS4     ]
 8:00 pm [     TivoS3     ] [     TivoS4     ]
 8:30 pm
 9:00 pm [     TivoS3     ] [     TivoS4     ] [    DVR 1FA0    ]
 9:30 pm [     TivoS4     ]
10:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ] [     TivoS4     ] [    DVR 1FA0    ]
10:30 pm
11:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ]
11:30 pm [     TivoS3     ]

Press Enter to see the next date.

Thu, 09/30
12:00 am
12:30 am
 1:00 am [     TivoS4     ]
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am [     TivoS4     ]
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm [     TivoS3     ]
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ] [     TivoS4     ]
 7:30 pm [     TivoS4     ]
 8:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ] [    DVR 1FA0    ]
 8:30 pm [     TivoS4     ]
 9:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ] [     TivoS4     ] [    DVR 1FA0    ]
 9:30 pm
10:00 pm [     TivoS3     ]
10:30 pm
11:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ]
11:30 pm [     TivoS3     ]

Press Enter to see the next date.

Fri, 10/01
12:00 am
12:30 am
 1:00 am [     TivoS4     ]
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm [     TivoS3     ]
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ] [     TivoS4     ]
 7:30 pm [     TivoS4     ]
 8:00 pm [     TivoS4     ] [     TivoS4     ]
 8:30 pm
 9:00 pm
 9:30 pm
10:00 pm [     TivoS3     ] [     TivoS4     ] [     TivoS4     ]
10:30 pm
11:00 pm [     TivoS3     ] [     TivoS3     ]
11:30 pm [     TivoS3     ]

Press Enter to see the next date.

Sat, 10/02
12:00 am [     TivoS4     ]
12:30 am
 1:00 am [     TivoS4     ] [    DVR 1FA0    ]
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm [     TivoS3     ]
 2:00 pm
 2:30 pm
 3:00 pm [     TivoS3     ] [     TivoS4     ]
 3:30 pm
 4:00 pm [     TivoS4     ]
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ] [     TivoS4     ]
 7:30 pm
 8:00 pm [     TivoS4     ]
 8:30 pm
 9:00 pm
 9:30 pm
10:00 pm [     TivoS4     ]
10:30 pm
11:00 pm
11:30 pm

Press Enter to see the next date.

Sun, 10/03
12:00 am
12:30 am
 1:00 am
 1:30 am
 2:00 am [     TivoS4     ]
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS3     ] [     TivoS3     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm
 5:30 pm
 6:00 pm
 6:30 pm
 7:00 pm [     TivoS4     ]
 7:30 pm
 8:00 pm [     TivoS4     ]
 8:30 pm [     TivoS4     ]
 9:00 pm [     TivoS4     ]
 9:30 pm [     TivoS4     ]
10:00 pm [     TivoS3     ] [    DVR 1FA0    ] [    DVR 1FA0    ]
10:30 pm [     TivoS3     ]
11:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ]
11:30 pm [    DVR 1FA0    ]

Press Enter to see the next date.

Mon, 10/04
12:00 am
12:30 am
 1:00 am
 1:30 am
 2:00 am [     TivoS3     ]
 2:30 am
 3:00 am [     TivoS4     ]
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm [    DVR 1FA0    ]
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm [     TivoS3     ]
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ] [     TivoS4     ]
 7:30 pm [     TivoS4     ] [     TivoS4     ]
 8:00 pm [    DVR 1FA0    ]
 8:30 pm
 9:00 pm [     TivoS3     ] [     TivoS4     ] [    DVR 1FA0    ]
 9:30 pm
10:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ]
10:30 pm [     TivoS3     ]
11:00 pm [     TivoS3     ] [     TivoS3     ]
11:30 pm [     TivoS3     ]

Press Enter to see the next date.

Tue, 10/05
12:00 am [     TivoS3     ] [     TivoS4     ]
12:30 am
 1:00 am [     TivoS4     ]
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm [    DVR 1FA0    ]
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ]
 7:30 pm [     TivoS4     ]
 8:00 pm [     TivoS4     ]
 8:30 pm
 9:00 pm [     TivoS3     ] [     TivoS3     ]
 9:30 pm
10:00 pm [     TivoS3     ]
10:30 pm [     TivoS3     ] [    DVR 1FA0    ]
11:00 pm [     TivoS3     ] [     TivoS3     ]
11:30 pm [     TivoS3     ]

Press Enter to see the next date.

Wed, 10/06
12:00 am [     TivoS3     ] [     TivoS4     ]
12:30 am
 1:00 am [     TivoS4     ]
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ]
 7:30 pm [     TivoS4     ] [     TivoS4     ]
 8:00 pm [     TivoS3     ] [     TivoS4     ]
 8:30 pm
 9:00 pm [     TivoS3     ] [     TivoS4     ]
 9:30 pm [     TivoS4     ]
10:00 pm [     TivoS3     ] [     TivoS3     ] [     TivoS4     ] [     TivoS4     ]
10:30 pm
11:00 pm [     TivoS3     ] [     TivoS3     ]
11:30 pm [     TivoS3     ]

Press Enter to see the next date.

Thu, 10/07
12:00 am [     TivoS4     ]
12:30 am
 1:00 am [     TivoS4     ]
 1:30 am
 2:00 am
 2:30 am
 3:00 am
 3:30 am
 4:00 am
 4:30 am
 5:00 am
 5:30 am
 6:00 am
 6:30 am
 7:00 am
 7:30 am
 8:00 am
 8:30 am
 9:00 am
 9:30 am
10:00 am
10:30 am [     TivoS4     ]
11:00 am [     TivoS4     ]
11:30 am

12:00 pm
12:30 pm
 1:00 pm
 1:30 pm
 2:00 pm
 2:30 pm
 3:00 pm
 3:30 pm
 4:00 pm
 4:30 pm
 5:00 pm [     TivoS3     ]
 5:30 pm [     TivoS3     ]
 6:00 pm [     TivoS3     ]
 6:30 pm
 7:00 pm [     TivoS4     ] [     TivoS4     ]
 7:30 pm [     TivoS4     ]
 8:00 pm
 8:30 pm
 9:00 pm
 9:30 pm
10:00 pm
10:30 pm
11:00 pm
11:30 pm

TivoS3   has 107 recodings scheduled
DVR 1FA0 has  20 recodings scheduled
TivoS4   has 107 recodings scheduled

Press Enter to exit

14:35:39>


----------



## tomm1079

wow this is really nice man. Very good job on this. 

glad to see this kind of progress. I was trying to figure out a way to setup a webpage on my Windows Home server that i could access to see if i had anything conflicting for remote scheduling. This makes it even more possible.

I feel someone with more knowledge then me will come up with Coop scheduling based on this.


----------



## orangeboy

tomm1079 said:


> wow this is really nice man. Very good job on this.
> 
> glad to see this kind of progress. I was trying to figure out a way to setup a webpage on my Windows Home server that i could access to see if i had anything conflicting for remote scheduling. This makes it even more possible.
> 
> I feel someone with more knowledge then me will come up with Coop scheduling based on this.


Thank you!
I'm positive the code could be written more efficiently, but my programming experience isn't object oriented. That said, I do like python, and I'll continue to hone my skills with it.

As far as cooperative scheduling, I think that the possibility may exist after looking at the HTML from the various tivo TCO pages. The To Do List pages I parse to get the date, time and (partial) show title has "href" links that can be manipulated to get to a show's details (footnote 1). Here's an example for "That 70's Show":



Code:


https://www3.tivo.com/tivo-tco/go.do?def=dvrmgmt.details.snippet.page&contentId=tivo:ct.60369985&collectionId=tivo:cl.17211&hdtv=false

Gather collectionId and contentId, and apply it to a slightly different base url to produce a link to the full description:


Code:


https://www3.tivo.com/tivo-tco/program/show.do?collectionId=tivo:cl.17211&contentId=tivo:ct.60369985

Now _that_ resulting page is indeed VERY interesting! It has links for "1-Click Record", "1-Click Season Pass", and "Record with options". I took the href'ed link in "1-Click Season Pass", and added "&tsn=<one of my TiVo's TSN's>", and successfully added a Season Pass to the TiVo that wasn't selected in the browser!



Code:


https://www3.tivo.com/tivo-tco/1clickseason.do?offerId=tivo:of.ctd.10420545.27-1.terrestrial.2010-09-27-03-00-00.1800&tsn=<one of my TiVo's TSN's>

This page offers the recording options as well, but the show is provided in a Search term:


Code:


https://www3.tivo.com/tivo-tco/search/simple.do?dispatch=simplesearch&searchFor=That+70's+Show&submit_button=

There are a lot of pieces that I think could be put together to at least get a backup of Season Passes, possibly a way to restore from that backup (footnote 2), and provide the cooperative scheduling that people want.

Footnotes:

The show's duration is provided in these details, which may be added to the existing TiVoToDo.py for a more accurate representation of what DVR is recording at what time.

I tried submitting a "1-Click Season Pass" using a date in the past (2010-09-20), but that resulted in a failure message from tivo.com, with the reason "There are no episodes available for <DVR name> in the next 14 days".


----------



## reneg

I like what I see so far. It's a shame you have to scrape web pages to get the data instead of just being able to query the Tivo. Bad Tivo, Bad!

If you're looking for input, here is my feedback:
1) I'd like to be able to exclude (or only include certain) Tivos. I only care about the todo lists on two of the four Tivos in the household.
2) Appears to be an ordering issue with shows starting at 12:XX PM . 


Code:


['09/26', 'Sun', ' 9:00', 'pm', '  Family Room   ', '         Mad Men         ']
['09/26', 'Sun', '11:03', 'pm', '  Family Room   ', '         Rubicon         ']
['09/26', 'Sun', '12:00', 'pm', '  Family Room   ', '      NASCAR Racing      ']
['09/26', 'Sun', '12:00', 'pm', '  Family Room   ', '       NFL Football      ']

3) Increase import friendliness by removing brackets, and leading & trailing white space within quoted text. My inclination was to import the first section into Excel, but the data required a lot of cleanup. As the program evolves and the output becomes better formatted, this may not be necessary.
4) Didn't notice any ill effects on my Windows system


Code:


config_files = ['/etc/TiVoToDo.conf', os.path.join(p, 'TiVoToDo.conf')]


----------



## orangeboy

reneg said:


> I like what I see so far. It's a shame you have to scrape web pages to get the data instead of just being able to query the Tivo. Bad Tivo, Bad!


Thank you!
And agreed. Until an unhacked TiVo presents access to Season Passes (proper), WishLists, and/or To Do Lists, I'll use what I can! 



reneg said:


> If you're looking for input, here is my feedback:
> 1) I'd like to be able to exclude (or only include certain) Tivos. I only care about the todo lists on two of the four Tivos in the household.


Definitely a possibility. Adding an incl/excl section in the conf file should take care of that. I went with using the DVRs listed in the account because the ToDo list requests use the TSN and not the DVR name. But, I think having the name(s) in the conf file, I could reconcile the TSNs.



reneg said:


> 2) Appears to be an ordering issue with shows starting at 12:XX PM .
> 
> 
> Code:
> 
> 
> ['09/26', 'Sun', ' 9:00', 'pm', '  Family Room   ', '         Mad Men         ']
> ['09/26', 'Sun', '11:03', 'pm', '  Family Room   ', '         Rubicon         ']
> ['09/26', 'Sun', '12:00', 'pm', '  Family Room   ', '      NASCAR Racing      ']
> ['09/26', 'Sun', '12:00', 'pm', '  Family Room   ', '       NFL Football      ']


Aw crap. I think this is fixable by converting the gathered ToDo list times to military time just before sending it off to be sorted. A convert back to civilian time after it's sorted should produce the correct order...



reneg said:


> 3) Increase import friendliness by removing brackets, and leading & trailing white space within quoted text. My inclination was to import the first section into Excel, but the data required a lot of cleanup. As the program evolves and the output becomes better formatted, this may not be necessary.


Yeah, this should be easy. As it is now, I just print a "list" of right/left/center justified values. I'm thinking a command-line argument could indicate how to create output. For example, TiVoToDo.py "csv" would create an Excel friendly, unjustified TiVoToDo.csv file, and TiVoToDo.py <no argument> or TiVoToDo.py "display" would output to the command line as it does now.



reneg said:


> 4) Didn't notice any ill effects on my Windows system
> 
> 
> Code:
> 
> 
> config_files = ['/etc/TiVoToDo.conf', os.path.join(p, 'TiVoToDo.conf')]


I plagiarized some of William's pyTivo code to get this script to work, and left that part in there to make it platform independent. If *nix users want to put the conf file in /etc, this will support that too.

Is the verbosity ok? Did you wonder what was going on as it was running? I had some additional output code written in as I was testing, but pulled it out for the final result. Maybe I pulled out too much?


----------



## txporter

Wow! This is very cool. I am very interested in a way to output this to a csv file or something like that to be able to manipulate in excel. I have actually just purchased a Premiere and plan to replace my my unit with it (or at least supercede it). It would be excellent to be able to use this to redo the season passes.


----------



## orangeboy

txporter said:


> Wow! This is very cool. I am very interested in a way to output this to a csv file or something like that to be able to manipulate in excel. I have actually just purchased a Premiere and plan to replace my my unit with it (or at least supercede it). It would be excellent to be able to use this to redo the season passes.


Yeah, the https://www3.tivo.com/tivo-tco/1clickseason.do?offerId=tivo:<some value>.<channel>.<provider type>.<date>&tsn=<TiVo TSN> links would make VERY quick work of creating Season Passes on a new box from an existing To Do list!

Edit: Given the failure message received from TiVo when I tried to create a Season Pass using a past date, I wonder if the date is arbitrary in the link being passed, as long as it's within the two-week period that the Guide Data sees. Something new to test! The "That 70's Show" isn't a good test case, since it's repeated nightly in syndication for me. I'll look for a new series to play with...

Re: Edit: Fail. Kind of. I tried scheduling "Outsourced" using a different date and time. The Season Pass was created, but for the 11:00 News, which I'm sure coincides with the date and time I passed along. So it appears that the "offerId" value doesn't explicitly contain a show's Id, but uses the channel, provider, date and time as the target for the Season Pass.


----------



## SeanC

Hmmmm, tried to use it, the python window pops up, all I get is:


Press Enter when ready to see dates.



Press Enter to exit

Any idea what the problem could be?


----------



## orangeboy

SeanC said:


> Hmmmm, tried to use it, the python window pops up, all I get is:
> 
> Press Enter when ready to see dates.
> 
> Press Enter to exit
> 
> Any idea what the problem could be?


TiVoToDo.conf is populated and found in the same folder as TiVoToDo.py?

Sample TiVoToDo.conf:


Code:


[email]
email = [email protected]

[password]
password = supersecretpassword

email is the email address used to login to tivo.com's website.
password is the password to the site.


----------



## SeanC

Yeah, just double and triple checked that the files are named correctly, in the same folder (new folder on the desktop), and the username and pass are the same as on the Tivo.com website.


----------



## orangeboy

SeanC said:


> Yeah, just double and triple checked that the files are named correctly, in the same folder (new folder on the desktop), and the username and pass are the same as on the Tivo.com website.


Do you have Series 3 or greater TiVos? Series2 and less aren't supported on the TiVo To Do List pages at tivo.com.

And also, if you are participating in a Beta Project (NTTABPs ), I can provide an alternate link to access those To Do pages.


----------



## SeanC

orangeboy said:


> Do you have Series 3 or greater TiVos? Series2 and less aren't supported on the TiVo To Do List pages at tivo.com.
> 
> And also, if you are participating in a Beta Project (NTTABPs ), I can provide an alternate link to access those To Do pages.


One active S3 and I'm not in a tivo beta.

Without having an error message from the python window, tough to know whats happening in there, but yeah, it does seem to be username/password related because no matter what I put in for U/P the script does the same thing.


----------



## orangeboy

SeanC said:


> One active S3 and I'm not in a tivo beta.
> 
> Without having an error message from the python window, tough to know whats happening in there, but yeah, it does seem to be username/password related because no matter what I put in for U/P the script does the same thing.


Here's a small chunk of the code to only do the login part, and display the raw html result (uses the same TiVoToDo.conf, so put TestLogin.py in the same new folder on your desktop):

TestLogin.py


Code:


#!/usr/bin/python
#TestLogin.py

import sys
import os.path
import urllib
import urllib2
import cookielib
import ConfigParser

p = os.path.dirname(__file__)
config = ConfigParser.ConfigParser()
config_files = ['/etc/TiVoToDo.conf', os.path.join(p, 'TiVoToDo.conf')]
configs_found = config.read(config_files)

if not configs_found:
    print ('ERROR: TiVoToDo.conf does not exist.\n' +
           'You must create this file before running TiVoToDo.')
    sys.exit(1)
config.read(config_files)

if not config.has_section('email'):
    print 'TiVo account email required in TiVoToDo.conf'
    sys.exit(1)
email = config.get('email', 'email')

if not config.has_section('password'):
    print 'TiVo account password required in TiVoToDo.conf'
    sys.exit(1)
password = config.get('password', 'password')

header = {'User-agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}
base_url = 'https://www3.tivo.com'
todo_url = '/tivo-tco/go.do?def=tco.todo.page'
npl_url = '/tivo-tco/go.do?def=tco.nowplaying.page'

cookiefile = 'cookies.lwp'
urlopen = urllib2.urlopen
Request = urllib2.Request
cj      = cookielib.LWPCookieJar()

if os.path.isfile(cookiefile):
    cj.load(cookiefile)

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)

def login(target_url, email, password):
    url = target_url + '/tivo-tco/login.do'
    login_data = urllib.urlencode({
        'cams_cb_partner': None,
        'cams_security_domain': 'tivocom',
        'cams_login_config': 'http',
        'cams_original_url': npl_url,
        'cams_cb_username': email,
        'cams_cb_password': password,
        'remember_email': 'true',
        'cams_cb_rememberme': 'true'
    })
    return url, login_data

def request_url(url, data=None, header=header):
    if data is None:
        data = None
    try:
        req = Request(url, data, header)
        handle = urlopen(req)
    except IOError, e:
        print 'We failed to open "&#37;s".' % url
        if hasattr(e, 'code'):
            print 'We failed with error code - %s.' % e.code
            exit()
    else:
        result = handle.read()
        print result

page = 'NPL'
url, login_data = login(base_url, email, password)
request_url(url, login_data, header)

x = raw_input("Press Enter to exit")
exit ()

In the first few lines, a good result will have:


Code:


    <title>
                My Now Playing List - TiVo
        </title>

No/Bad password will have:


Code:


    <title>
                TiVo account login - TiVo
        </title>

It spits out a LOT of HTML code...


----------



## SeanC

Results pasted below, I have the entire output but didn't want to paste it in case there were any personal data in there I might want to protect. Anyway it does look like it's logging in correctly



Code:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">





<!-- 
BUILD
Version: 5.0.3-PCI2
Date: Wed Mar 24 11:11:29 PDT 2010
User: weblogic
Host: Host Unknown
Localhost: prd05
-->


 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<!-- // --><script language='javascript' type='text/javascript'>
<!--
	req_80_1285512725=new Image();
req_80_1285512725.src='/__ssobj/ard.png?5521235108306139836_1_0-80-'+(32591*39443+25911);
//-->
<!-- // --></script>

    <title>
        	My Now Playing List - TiVo
        </title>


----------



## orangeboy

SeanC said:


> Results pasted below, I have the entire output but didn't want to paste it in case there were any personal data in there I might want to protect. Anyway it does look like it's logging in correctly
> 
> 
> 
> Code:
> 
> 
> <my snippage>
> <title>
> My Now Playing List - TiVo
> </title>


That's exactly what I was looking for, and you're right, it's logging in with no problems. What do you see when you go to this page?: http://www3.tivo.com/tivo-tco/go.do?def=tco.todo.page

That's the source I'm using to populate the values.


----------



## SeanC

orangeboy said:


> That's exactly what I was looking for, and you're right, it's logging in with no problems. What do you see when you go to this page?: http://www3.tivo.com/tivo-tco/go.do?def=tco.todo.page


I was asked to login to the tivo.com website, and after I did I was taken straight to my ToDo list.


----------



## orangeboy

SeanC said:


> I was asked to login to the tivo.com website, and after I did I was taken straight to my ToDo list.


I think you found a bug! I'm guessing that since you have only one TiVo on your account, the DVR list I gather isn't included in the same way as accounts with multiple DVRs. That HTML that you captured doesn't contain anything sensitive (other than your tivo's TSN and viewing habits). I'd be appreciative if you could PM me that output!


----------



## SeanC

PM sent.


----------



## orangeboy

SeanC said:


> PM sent.


Message received. Thanks! Yep, there's not a TSN found in that page when there's only 1 DVR on the account.

Rats.

I'll have to account for that! Imagine at this point, the script is producing the word "None" in place of the TSN number that is needed to identify the DVR. If the result were blank instead of None, I bet it would work.

Thanks again Sean!
I think you'll have to wait until I get this one sorted out before you can use it.


----------



## SeanC

Bummah 

Ah well, glad I could help out, I'll watch this thread for updates.


----------



## tomm1079

I would also like to let people know. If you have any characters other then Spaces, Letters and Numbers in your DVR names it breaks the Tivo.com website for getting now playing list and Todo list. This causes the script to fail. Once you clean up these special characters the script starts to work again.

I had this issue and just wanted to pass it onto everyone.


----------



## moyekj

orangeboy, you probably can add the bonjour and tivo beacon code for TiVo discovery. That information includes tsn numbers of discovered TiVos so they don't necessarily have to be scraped from web page. (Of course running this outside LAN the discovery won't return anything in which case a manual configuration option could be available).


----------



## orangeboy

tomm1079 said:


> I would also like to let people know. If you have any characters other then Spaces, Letters and Numbers in your DVR names it breaks the Tivo.com website for getting now playing list and Todo list. This causes the script to fail. Once you clean up these special characters the script starts to work again.
> 
> I had this issue and just wanted to pass it onto everyone.


Hmm. I'm not following. I don't use any of the TiVo's names when interacting with the website, only the TSN which is a number. I actually get the names from the Now Playing List, and only use them for display. What kind of failure takes place, and what characters were being used?


----------



## orangeboy

moyekj said:


> orangeboy, you probably can add the bonjour and tivo beacon code for TiVo discovery. That information includes tsn numbers of discovered TiVos so they don't necessarily have to be scraped from web page. (Of course running this outside LAN the discovery won't return anything in which case a manual configuration option could be available).


Long term, that is and should be the way to go (with optional incl/excl list in .conf), which would eliminate the first call to the Now Playing List to scrape the list of TSNs and names. I'm still too new to python to know how to import other python files. That, and I'm more versed in "linear" programming I guess, with concepts of subroutines/calls/gotos/whatever, whenever I need to branch. There's a lot of duplicate code that I failed to create a function for at the end of the script. :down:

As this evolves (which I want it to), I'm sure I'll have to and want to package up some of the reusable code into their own files, and make use of some of the code or packages that's already available. Command line output isn't pretty, and it feels like it's at "a caveman knocking rocks together for fire" level at this point. Ideally, this would have some kind of presence on a TiVo, where cooperative scheduling could be taken advantage of (maybe browse another TiVo's To Do list to see if a time slot and tuner is open). We'll see where it goes though!


----------



## moyekj

If that is the direction you want to go then you should probably look into making it an HME application (using wmcbrine's python HME) which then obviously will run from a TiVo.
python does have a Tk GUI and for examples of that you can look at wmcbrine's tivoremote application (which incidently also includes TiVo discovery code). However Tk based GUIs are usually pretty simple/ugly as I learned from early days kmttg using Perl/Tk. In fact adding GUI of any kind makes the whole code base much harder to deal with in general. So I say focus on core functionality first and then perhaps a GUI wrapper around it later.


----------



## tomm1079

orangeboy said:


> Hmm. I'm not following. I don't use any of the TiVo's names when interacting with the website, only the TSN which is a number. I actually get the names from the Now Playing List, and only use them for display. What kind of failure takes place, and what characters were being used?


This was more for everyone else. Tivo.com website has a bug where you cannot see your To Do list or now playing list if you have special characters in the Tivo name. Which would cause your program to fail since you cant scrap that information.


----------



## orangeboy

OK, I've been working on this, and added some features and fixes. I now scan the LAN for TiVos using Zeroconf (included in the attached zip file), so I don't solely rely on the tivo.com website to get the TiVo names and their TSNs. That should make the results a bit more relevant as a "household" To Do List, and it won't cause problems for those with only one TiVo on their account.

The .conf file has been expanded greatly, and has only two required values that need to be set. Everything else is up to user preference, including a TiVo name exclusion list, creation of .csv files (filenames derived from the date, when applicable), and whether or not to display anything on the console (other than progress messages). I put in an "minimum TiVo count" option, due to some issues I've been having with consistently finding all the TiVos on the LAN. I have that value in my .conf file set to "2", so if either my Series3 and Premiere don't answer, the program won't run. Options can be set or left blank, causing default values to be used.

You'll note that the .conf file also has options for Season Pass values. These aren't useful at this time. I placed them there for future use. My intention was to use the =HYPERLINK() function in a generated csv file to allow creation or recreation of Season Passes on new or existing TiVos. I found that the generated url inside the csv cell well exceeds 256 characters, the limit in Excel for data of that type (and MS Word - I tried there too!). I'm very disappointed that that feature didn't work as expected, but I am glad to find that I can glean the required pieces to create a Season Pass url (confirmed by copy/pasting the generated url into a browser!).

So. While poking around the different pages trying to find all that Season Pass stuff, I came across some other useful display data as well. So now besides showing the upcoming list by date, and a date matrix showing TiVo tuner activity, I now also present a list of the shows, which TiVo the show was recorded on, and available channels that the show is also airing on. Could be helpful if you wanted to catch up on shows that have gone into syndication (an example: I'm hooked on Criminal Minds at the moment, and have a ARWL that now records from 4 different channels - I could setup Season Passes for certain channels, and be a bit more selective on what to record). Due to how I'm now storing the data a capture, unfortunately I don't have a total count per TiVo anymore. I'll try to get that back.

I added a "Shows" caching feature to help cut execution time. The path I follow to get the relevant data takes me from the initial TCO login page to the ToDo List, then to a show's detail's page, and finally to a "Record with Options" page. With having the show's information cached, most of that web page activity is removed. The following is consecutive runs of the program ("display = False" in .conf) with the "shows.cache" file being created (3 1/2 minutes), then read from on the second run (49 seconds):



Code:


Tue 10/05
19:53:03=>FOR /L %a IN (1,1,2) DO tivotodo.py

Tue 10/05
19:53:28=>tivotodo.py
Scanning for TiVos...  and found 2: TivoS3 TivoS4
Logging in...
Searching...
working on TivoS3
Added title: "Criminal Minds" to cache.
Added title: "Austin City Limits" to cache.
Added title: "New Yankee Workshop" to cache.
Added title: "That '70s Show" to cache.
Added title: "Adam-12" to cache.
Added title: "Emergency!" to cache.
Added title: "Hell's Kitchen" to cache.
Added title: "The Whole Truth" to cache.
Added title: "Everyday Edisons" to cache.
Added title: "Nova scienceNOW" to cache.
Added title: "CSI: Crime Scene Investigation" to cache.
Added title: "Woodwright's Shop" to cache.
Added title: "Ask This Old House" to cache.
Added title: "This Old House" to cache.
Added title: "Hometime" to cache.
Added title: "48 Hours Mystery" to cache.
Added title: "McLaughlin Group" to cache.
Added title: "The Red Green Show" to cache.
Added title: "The Unit" to cache.
working on TivoS4
Added title: "Jeopardy!" to cache.
Added title: "Muscle Car Workout" to cache.
Added title: "Alfred Hitchcock Presents" to cache.
Added title: "South Park" to cache.
Added title: "Star Trek: The Next Generation" to cache.
Added title: "Petticoat Junction" to cache.
Added title: "The Middle" to cache.
Added title: "Law & Order: Special Victims Unit" to cache.
Added title: "Cougar Town" to cache.
Added title: "Art Wolfe's Travels to the Edge" to cache.
Added title: "Community" to cache.
Added title: "30 Rock" to cache.
Added title: "The Office" to cache.
Added title: "Nikita" to cache.
Added title: "Dateline NBC" to cache.
Added title: "Outlaw" to cache.
Added title: "20/20" to cache.
Added title: "Rawhide" to cache.
Added title: "Cops" to cache.
Added title: "Legend of the Seeker" to cache.
Added title: "60 Minutes" to cache.
Added title: "The Simpsons" to cache.
Added title: "The Cleveland Show" to cache.
Added title: "Family Guy" to cache.
Added title: "American Dad" to cache.
Added title: "The Event" to cache.
Added title: "Lie to Me" to cache.
Added title: "Chase" to cache.
Added title: "Fringe" to cache.
Added title: "Smallville" to cache.
Done searching


Finished: 10/05 Tue
Finished: 10/06 Wed
Finished: 10/07 Thu
Finished: 10/08 Fri
Finished: 10/09 Sat
Finished: 10/10 Sun
Finished: 10/11 Mon
Finished: 10/12 Tue
Finished: 10/13 Wed
Finished: 10/14 Thu
Finished: 10/15 Fri
Finished: 10/16 Sat
Finished: 10/17 Sun

Please check E:\Development\TiVoToDo\Test\output for the output.

Tue 10/05
19:56:57=>tivotodo.py
Scanning for TiVos...  and found 2: TivoS3 TivoS4
Logging in...
Searching...
working on TivoS3
working on TivoS4
Done searching


Finished: 10/05 Tue
Finished: 10/06 Wed
Finished: 10/07 Thu
Finished: 10/08 Fri
Finished: 10/09 Sat
Finished: 10/10 Sun
Finished: 10/11 Mon
Finished: 10/12 Tue
Finished: 10/13 Wed
Finished: 10/14 Thu
Finished: 10/15 Fri
Finished: 10/16 Sat
Finished: 10/17 Sun

Please check E:\Development\TiVoToDo\Test\output for the output.

Tue 10/05
19:57:46=>

csv files and console output aren't going to cut it. I downloaded a copy of wmcbrine's python HME, but haven't looked into using it yet. Having an app on the TiVo showing this information, with the ability to navigate and select an option would be ideal, and I wouldn't have to rely on some other form of url manipulation (csv HYPERLINK, or whatever); I could take the request from the tivo, and use python to do the post for the Season Pass. I guess I've got more learning to do!

Feedback is always welcome, as are questions...

Edit: my prompt string is $d$h$h$h$h$h$_$t$h$h$h$q$g. 

Second edit: At this time, the date matrix only shows the *Start* times of a recording. If the recordings are two hours, at this time, the matrix won't reflect that. I do have Show duration as a variable, but haven't incorporated it into spanning the appropriate timeslots. That's #1 priority for now. HME stuff will have to take a back-burner since that will take me awhile to figure out. I could provide a schema for the variables I'm using if anyone wants to help/modify the code... I hate to say it, but again, the source is sorely lacking in documentation . Accurate depiction of the data #1 priority, documentation #2, followed by HME stuff...

Third edit: File removed.

Fourth edit: File removed again :down:


----------



## tomm1079

I am getting an error:



Code:


Traceback (most recent call last):
  File "C:\Users\Tom\Desktop\TiVoToDo\TiVoToDo.py", line 175, in <module>
    if c.tdl[a][2] >= mt[b]:
TypeError: list indices must be integers, not tuple

It happens after i hit enter when it tells me "Viewing Shows. Press Enter to continue"


----------



## orangeboy

tomm1079 said:


> I am getting an error:
> 
> 
> 
> Code:
> 
> 
> Traceback (most recent call last):
> File "C:\Users\Tom\Desktop\TiVoToDo\TiVoToDo.py", line 175, in <module>
> if c.tdl[a][2] >= mt[b]:
> TypeError: list indices must be integers, not tuple
> 
> It happens after i hit enter when it tells me "Viewing Shows. Press Enter to continue"


Bleh. Delete those files. I think I have a packaging error, and zipped the wrong folder. :down:


----------



## Allanon

I get an "IndexError: list index out of range" error. Attached is the output from the program.

EDIT: Just noticed you removed the files, I hope this error was due to the packaging error.


----------



## orangeboy

GRR. I'm getting the same thing. I just ran this at 8:00 EST. Going to http://www3.tivo.com/tivo-tco/go.do?def=tco.todo.page (To Do List), then clicking on one of the show details, it does appear the page layout is different. It also shows that my To Do List hasn't updated in awhile. The first entry is for 10/5, 10:30 pm EST, about 2 1/2 hours ago. Double GRR. I told Tom to delete the files, suspecting a problem at my end. Let me dig in a bit, and see what's going on...


----------



## orangeboy

And now it's working again...


----------



## Allanon

orangeboy said:


> And now it's working again...


I tried running it again and still get the same error.


----------



## orangeboy

Dunno. I had worse results, not even getting one show's info, and the exact same error at 12:45 am, but since about 1:30, no problems. As a further test, I unpacked the zip file and ran that a half dozen times without problem. The online To Do page seems to be updated with current info, which is a good sign.


----------



## gonzotek

orangeboy said:


> You'll note that the .conf file also has options for Season Pass values. These aren't useful at this time. I placed them there for future use. My intention was to use the =HYPERLINK() function in a generated csv file to allow creation or recreation of Season Passes on new or existing TiVos. I found that the generated url inside the csv cell well exceeds 256 characters, the limit in Excel for data of that type (and MS Word - I tried there too!). I'm very disappointed that that feature didn't work as expected, but I am glad to find that I can glean the required pieces to create a Season Pass url (confirmed by copy/pasting the generated url into a browser!).


A url shortener should take care of the 256 char problem. They work well enough for twitter and friends. Bit.ly, for instance, has an api, although they do some rate-limiting, so I don't really know what would happen if all 300+ programs on my NPL were shortened at once. Of course when you get to the app, shortening would also be unnecessary.


----------



## moyekj

orangeboy said:


> Dunno. I had worse results, not even getting one show's info, and the exact same error at 12:45 am, but since about 1:30, no problems. As a further test, I unpacked the zip file and ran that a half dozen times without problem. The online To Do page seems to be updated with current info, which is a good sign.


 That's the problem scraping data from public URLs. A long time ago I had program scraping guide data for ReplayTV DVRs and it just became a hassle whenever the web site was updated. I wish TiVo provided interface to the TiVo web server for obtaining ToDo lists and for scheduling. Early 40xx ReplayTV models even had local network scheduling capabilities eons ago which made for great cooperative scheduling capabilities among several units with aid of 3rd party programs.


----------



## orangeboy

moyekj said:


> That's the problem scraping data from public URLs. A long time ago I had program scraping guide data for ReplayTV DVRs and it just became a hassle whenever the web site was updated. I wish TiVo provided interface to the TiVo web server for obtaining ToDo lists and for scheduling. Early 40xx ReplayTV models even had local network scheduling capabilities eons ago which made for great cooperative scheduling capabilities among several units with aid of 3rd party programs.


Agreed that HTML (and xml) scraping is not the most ideal solution, but the want and need for Season Pass management is abound. This little project could help provide a solution to the lack of cooperative scheduling and Season Pass backup, and it's helping keep the old noggin from getting too soft! 

I finally got around to running the "start.py" from the HME for Python package last night. Looks like good stuff.


----------



## tomm1079

orangeboy,
is the currently packed version a good version to use now for this?


----------



## orangeboy

tomm1079 said:


> orangeboy,
> is the currently packed version a good version to use now for this?


It's actually the same one. I think the issues were with the tivo site, since I was able to finally get results with no modification to the code. I'm thinking it's the time of day that causes problems.


----------



## tomm1079

orangeboy said:


> It's actually the same one. I think the issues were with the tivo site, since I was able to finally get results with no modification to the code. I'm thinking it's the time of day that causes problems.


ok cause i have ran it a few times over the last few days (including 3 times today) and i always get the same error


Code:


Viewing Shows. Press Enter to continue

Traceback (most recent call last):
  File "C:\Users\Tom\Desktop\TiVoToDo\TiVoToDo.py", line 175, in <module>
    if c.tdl[a][2] >= mt[b]:
TypeError: list indices must be integers, not tuple


----------



## innocentfreak

Nevermind. It helps if you put the login info in the right place.


----------



## orangeboy

tomm1079 said:


> ok cause i have ran it a few times over the last few days (including 3 times today) and i always get the same error
> 
> 
> Code:
> 
> 
> Viewing Shows. Press Enter to continue
> 
> Traceback (most recent call last):
> File "C:\Users\Tom\Desktop\TiVoToDo\TiVoToDo.py", line 175, in <module>
> if c.tdl[a][2] >= mt[b]:
> TypeError: list indices must be integers, not tuple


That is just absolutely bizarre.

'a' should be an integer, as defined here as the 'length' of the To Do List:


Code:


for a in range(len(c.tdl)):

'2' is definitely an integer, and
'b' should also be an integer, as defined here as the length of a "military time" list:


Code:


for b in range(len(mt)):

I'll PM you shortly...


----------



## Allanon

Might be a little easier to scrape this page:

http://www3.tivo.com/tivo-tco/go.do?def=todo.content.body&orderBy=startTime&groupBy=&offset=0&tsn=

Make sure you are logged in and as you can see you can specify a TSN.


----------



## orangeboy

Allanon said:


> Might be a little easier to scrape this page:
> 
> http://www3.tivo.com/tivo-tco/go.do?def=todo.content.body&orderBy=startTime&groupBy=&offset=0&tsn=
> 
> Make sure you are logged in and as you can see you can specify a TSN.


Thanks - That one is already on my list 



Code:


base_url = 'https://www3.tivo.com'                  # Production TiVo website
indx_url = '/tivo-tco/index.do'                     # TCO login page
show_url = '/tivo-tco/program/show.do?'             # Show detail page
spwo_url = '/tivo-tco/confrecoptions.do?'           # Season Pass w/Options
todo_url = '/tivo-tco/go.do?def=tco.todo.page'      # To Do List page


----------



## innocentfreak

Mine keeps closing while adding titles to the cache. I don't know why since it closes so quickly I can't read if it gives an error. It would be helpful if required a prompt to actually close the Python window in this case. Looking in my cache folder I also don't see anything showing the titles were saved and when I launch it again it repeats the process.


----------



## orangeboy

innocentfreak said:


> Mine keeps closing while adding titles to the cache. I don't know why since it closes so quickly I can't read if it gives an error. It would be helpful if required a prompt to actually close the Python window in this case. Looking in my cache folder I also don't see anything showing the titles were saved and when I launch it again it repeats the process.


chchchhchch (that's the sound of me choking on my own rage)...
It sounds like you're getting an error, too. Running it from a console/command prompt, changing to the directory where it's installed, and issuing TiVoToDo.py would run the .py file in that window. Any successful or failed attempts at running would remain in that window and available for scrutiny.

There's got to be something different in my environment that is preventing me from (consistently) getting the same errors as those trying it. I was able to exactly reproduce this problem the other night:



Code:


Traceback (most recent call last):
  File "C:\tivotodo\TiVoToDo.py", line 75, in <module>
    r.request_url(url, parser, login_data)
  File "C:\tivotodo\request.py", line 30, in request_url
    parser.feed(result)
  File "C:\Python25\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\Python25\lib\HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "C:\Python25\lib\HTMLParser.py", line 268, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "C:\tivotodo\tools.py", line 346, in handle_starttag
    r.request_url(url, parser, login_data)
  File "C:\tivotodo\request.py", line 30, in request_url
    parser.feed(result)
  File "C:\Python25\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\Python25\lib\HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "C:\Python25\lib\HTMLParser.py", line 268, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "C:\tivotodo\tools.py", line 459, in handle_starttag
    c.rdi_schd = a[5]
IndexError: list index out of range

I suspected the tivo website as the cause since I was able to successfully rerun about an hour later without modification to the code. 

I'm gonna pull the zip file (again). I just downloaded python 2.6.4, 2.6.6, and 2.7 to setup different environments. I've only been testing in 2.6.2 on Win XP


----------



## innocentfreak

I am running win 7 64 bit but had the same results on a 32 bit setup. Both are using Python 2.6.2. Currently testing it and it is repeating the adding titles to cache process for my first TiVo.

Looks like the same error as above



Code:


Traceback (most recent call last):
  File "C:\TiVoToDo\TiVoToDo.py", line 75, in <module>
    r.request_url(url, parser, login_data)
  File "C:\TiVoToDo\request.py", line 30, in request_url
    parser.feed(result)
  File "C:\Python26\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\Python26\lib\HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "C:\Python26\lib\HTMLParser.py", line 268, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "C:\TiVoToDo\tools.py", line 346, in handle_starttag
    r.request_url(url, parser, login_data)
  File "C:\TiVoToDo\request.py", line 30, in request_url
    parser.feed(result)
  File "C:\Python26\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\Python26\lib\HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "C:\Python26\lib\HTMLParser.py", line 268, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "C:\TiVoToDo\tools.py", line 459, in handle_starttag
    c.rdi_schd = a[5]
IndexError: list index out of range

c:\TiVoToDo>


----------



## Allanon

orangeboy said:


> Thanks - That one is already on my list
> 
> 
> 
> Code:
> 
> 
> base_url = 'https://www3.tivo.com'                  # Production TiVo website
> indx_url = '/tivo-tco/index.do'                     # TCO login page
> show_url = '/tivo-tco/program/show.do?'             # Show detail page
> spwo_url = '/tivo-tco/confrecoptions.do?'           # Season Pass w/Options
> todo_url = '/tivo-tco/go.do?def=tco.todo.page'      # To Do List page


It's not on your list, it would be:

todo_url = '/tivo-toc/go.do?def=todo.content.body'

The link I provided is just a very simple web page with just the todo list and nothing else. The one you are using has menus and a lot of other junk that would make it harder to scrape.


----------



## orangeboy

Allanon said:


> It's not on your list, it would be:
> 
> todo_url = '/tivo-toc/go.do?def=todo.content.body'
> 
> The link I provided is just a very simple web page with just the todo list and nothing else. The one you are using has menus and a lot of other junk that would make it harder to scrape.


My apologies! That is a nice link :up:
Has everything I need.


----------



## orangeboy

Alright, I pulled the zip file from the site again today. I did get a positive response back from tomm1079 stating that it is working for him after switching from Python 3.x to Python 2.x and it appears there's an errant or missing line break at line 175(?). I probably should have mentioned that earlier that 2.x is required. That being said, I don't think I'll reattach the zip file again. I'm close to presenting the data accurately, with the duration taken into account. I'd also like to put in logging, considering all the issues that folks have been experiencing. Once those tasks have been completed, I'll put up a new zip file either here, or in a new thread.


----------



## moyekj

May I suggest setting up a Google project (or Sourceforge, though I think Google is better) project for this or some other more permanent web site? Attaching zip files to threads that go away is hard to manage and for others to find.


----------



## orangeboy

moyekj said:


> May I suggest setting up a Google project (or Sourceforge, though I think Google is better) project for this or some other more permanent web site? Attaching zip files to threads that go away is hard to manage and for others to find.


Good idea. I created an empty project for now, as I learn how to use code.google.com.


----------



## tomm1079

orangeboy said:


> Alright, I pulled the zip file from the site again today. I did get a positive response back from tomm1079 stating that it is working for him after switching from Python 3.x to Python 2.x and it appears there's an errant or missing line break at line 175(?). I probably should have mentioned that earlier that 2.x is required. That being said, I don't think I'll reattach the zip file again. I'm close to presenting the data accurately, with the duration taken into account. I'd also like to put in logging, considering all the issues that folks have been experiencing. Once those tasks have been completed, I'll put up a new zip file either here, or in a new thread.


it would also be nice to put duration into the file called ToDo.By.TiVo.csv


----------



## orangeboy

tomm1079 said:


> it would also be nice to put duration into the file called ToDo.By.TiVo.csv


Done. Duration will show up right after "Show Title" in both "ToDo.By.TiVo.csv" and "ToDo.All.csv", since they both use a common function to create the csv.


----------



## innocentfreak

They would probably say no, but has anyone at least asked TiVo for access to some of the areas at least via IP? I figure it wouldn't hurt.


----------



## orangeboy

Ok, the google site isn't much to look at, but the project has been populated with source, and a downloadable zip file! Those that want to try it, the page is here: http://code.google.com/p/tivotodo/

Matching show to tuner has been worked out, so shows with a duration of greater then 30 minutes now span the time slots that a tuner would be occupied for that show. An example follows, were I have a hour long program that starts at 11:00 pm on "tuner 2" of my Series3 box, while "tuner 1" is occupied recording a 30 minute show, also at 11:00 pm:



Code:


10/17 Sun 12:00 am
10/17 Sun 12:30 am
10/17 Sun  1:00 am
10/17 Sun  1:30 am
10/17 Sun  2:00 am                                               TivoS4 (60)
10/17 Sun  2:30 am                                               TivoS4 (60)
10/17 Sun  3:00 am
10/17 Sun  3:30 am
10/17 Sun  4:00 am
10/17 Sun  4:30 am
10/17 Sun  5:00 am
10/17 Sun  5:30 am
10/17 Sun  6:00 am
10/17 Sun  6:30 am
10/17 Sun  7:00 am
10/17 Sun  7:30 am
10/17 Sun  8:00 am
10/17 Sun  8:30 am
10/17 Sun  9:00 am
10/17 Sun  9:30 am
10/17 Sun 10:00 am
10/17 Sun 10:30 am
10/17 Sun 11:00 am     TivoS3 (30)
10/17 Sun 11:30 am
10/17 Sun 12:00 pm
10/17 Sun 12:30 pm
10/17 Sun  1:00 pm
10/17 Sun  1:30 pm
10/17 Sun  2:00 pm
10/17 Sun  2:30 pm
10/17 Sun  3:00 pm
10/17 Sun  3:30 pm
10/17 Sun  4:00 pm                                               TivoS4 (60)
10/17 Sun  4:30 pm                                               TivoS4 (60)
10/17 Sun  5:00 pm
10/17 Sun  5:30 pm
10/17 Sun  6:00 pm
10/17 Sun  6:30 pm
10/17 Sun  7:00 pm                                               TivoS4 (60)
10/17 Sun  7:30 pm                                               TivoS4 (60)
10/17 Sun  8:00 pm
10/17 Sun  8:30 pm
10/17 Sun  9:00 pm
10/17 Sun  9:30 pm
10/17 Sun 10:00 pm
10/17 Sun 10:30 pm     TivoS3 (30)          TivoS3 (27)
10/17 Sun 11:00 pm     TivoS3 (30)          TivoS3 (60)          TivoS4 (30)
10/17 Sun 11:30 pm                          TivoS3 (60)

Attached is the accompanying csv file. The other suggestions have been incorporated as well, such as a new TCO To Do link to parse (thank you!) and inclusion of duration in the various csv files.

Tested and working on Windows XP (32 bit) with python versions 2.6.2, 2.6.4, 2.6.6, and 2.7. I have no plans at this time to try python 3.x, but I do have version 3.1.2 installed. I still would like *need* to implement logging to help debug some of the issues others had encountered.

It is offered "as-is", and hopefully it will only get better! 

Edit: I should mention that running in a console is a bit to be desired. The output can be greater than the default 80 columns. In Windows, right-clicking the title bar while the script is running will bring up a context menu where you can select "Properties". The Layout tab allows you to adjust both the buffer size and window size. I adjust my buffer size to 132 x 9999 and window size to 132 x 50. This handily accommodates my two TiVos, with what looks like room for _maybe_ one more tivo when viewing the date breakdown. Clicking OK will bring up another window where you can save those settings for future windows of the same title.


----------



## Allanon

orangeboy said:


> Edit: I should mention that running in a console is a bit to be desired. The output can be greater than the default 80 columns. In Windows, right-clicking the title bar while the script is running will bring up a context menu where you can select "Properties". The Layout tab allows you to adjust both the buffer size and window size. I adjust my buffer size to 132 x 9999 and window size to 132 x 50. This handily accommodates my two TiVos, with what looks like room for _maybe_ one more tivo when viewing the date breakdown. Clicking OK will bring up another window where you can save those settings for future windows of the same title.


Use the following console command to change the number of columns and lines:

mode <num col>, <num lines>

I made a batch file that looks like this:


Code:


mode 200
TivoToDo.py
pause

It allows me to just double click the batch file and run the program


----------



## SeanC

Win7 32 bit, Python 2.7. Previous version was working, getting the following error with the current version:



Code:


Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Sean>cd Desktop

C:\Users\Sean\Desktop>cd TiVoToDo.v0r2m1

C:\Users\Sean\Desktop\TiVoToDo.v0r2m1>TiVoToDo.py
Scanning for TiVos...  and found 1: S3
Logging in...
Searching...
working on S3
Traceback (most recent call last):
  File "C:\Users\Sean\Desktop\TiVoToDo.v0r2m1\TiVoToDo.py", line 73, in <module>

    r.request_url(url, parser, login_data)
  File "C:\Users\Sean\Desktop\TiVoToDo.v0r2m1\request.py", line 30, in request_u
rl
    parser.feed(result)
  File "C:\progra~1\Python27\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\progra~1\Python27\lib\HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "C:\progra~1\Python27\lib\HTMLParser.py", line 271, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "C:\Users\Sean\Desktop\TiVoToDo.v0r2m1\tools.py", line 468, in handle_sta
rttag
    r.request_url(url, parser, login_data)
  File "C:\Users\Sean\Desktop\TiVoToDo.v0r2m1\request.py", line 30, in request_u
rl
    parser.feed(result)
  File "C:\progra~1\Python27\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\progra~1\Python27\lib\HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "C:\progra~1\Python27\lib\HTMLParser.py", line 271, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "C:\Users\Sean\Desktop\TiVoToDo.v0r2m1\tools.py", line 596, in handle_sta
rttag
    c.rdi_schd = a[5]
IndexError: list index out of range

C:\Users\Sean\Desktop\TiVoToDo.v0r2m1>


----------



## innocentfreak

mine seemed to work but I got this error towards the end. I also need to check because I thought I told it to ignore one of my TiVos but it polled it anyway.



Code:


Traceback (most recent call last):
  File "C:\TiVoToDo\TiVoToDo.py", line 121, in <module>
    level2 = level1[7][0]
IndexError: list index out of range

Looking at my CSVs it choked during the by show output.


----------



## orangeboy

innocentfreak said:


> mine seemed to work but I got this error towards the end. I also need to check because I thought I told it to ignore one of my TiVos but it polled it anyway.
> 
> 
> 
> Code:
> 
> 
> Traceback (most recent call last):
> File "C:\TiVoToDo\TiVoToDo.py", line 121, in <module>
> level2 = level1[7][0]
> IndexError: list index out of range
> 
> Looking at my CSVs it choked during the by show output.


Thanks for opening an issue. I may end up asking you for your shows.cache file, since the data that's "missing" would be stored there. I'll update the issue if I need it.


----------



## tomm1079

worked great for me as long as i kept my cache from the previous version. If i deleted my cache i got errors when it moves to the 2nd DVR's cache


Code:


Traceback (most recent call last):
  File "D:\shares\Web\TiVoToDo\TiVoToDo.py", line 73, in <module>
    r.request_url(url, parser, login_data)
  File "D:\shares\Web\TiVoToDo\request.py", line 30, in request_url
    parser.feed(result)
  File "C:\Python27\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\Python27\lib\HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "C:\Python27\lib\HTMLParser.py", line 271, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "D:\shares\Web\TiVoToDo\tools.py", line 468, in handle_starttag
    r.request_url(url, parser, login_data)
  File "D:\shares\Web\TiVoToDo\request.py", line 30, in request_url
    parser.feed(result)
  File "C:\Python27\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\Python27\lib\HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "C:\Python27\lib\HTMLParser.py", line 271, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "D:\shares\Web\TiVoToDo\tools.py", line 596, in handle_starttag
    c.rdi_schd = a[5]
IndexError: list index out of range


----------



## innocentfreak

orangeboy said:


> Thanks for opening an issue. I may end up asking you for your shows.cache file, since the data that's "missing" would be stored there. I'll update the issue if I need it.


Only if you promise not to judge my shows 

Also you may want to see this link before you put too much work in. Of course they could have mistaken your project as one by TiVo lol. http://www.tivocommunity.com/tivo-vb/showthread.php?p=8180286#post8180286

EDIT: could someone with at least 3 TiVos try having it ignore 2 or more TiVos. If I enter more than one TiVo ignore doesn't seem to actually ignore. I am using commas like the description says and I verified the names on tivo.com


----------



## orangeboy

innocentfreak said:


> Only if you promise not to judge my shows
> 
> Also you may want to see this link before you put too much work in. Of course they could have mistaken your project as one by TiVo lol. http://www.tivocommunity.com/tivo-vb/showthread.php?p=8180286#post8180286


Holy <expletive> Batman! A "Season Pass Manager", huh? That's really where I wanted to go with this - all the pieces are there, for sure. Maybe that's why my app is flaky at times? Things going on behind the scenes specifically with TCO... I just don't know why I can run the thing all day, and it seems nobody else can get it to run once! 

Maybe I'll let the dust settle a bit over there at tivo.com before trying to make any fixes or enhancements.


----------



## innocentfreak

Mine ran fine. I updated the issue. It seems specific to a certain TiVo on mine so it may have a season pass causing the problem.


----------



## orangeboy

innocentfreak said:


> Mine ran fine. I updated the issue. It seems specific to a certain TiVo on mine so it may have a season pass causing the problem.


I'm glad it worked for you! :up:
I'll work on that exclusion list in the meantime...


----------



## orangeboy

innocentfreak said:


> ...
> EDIT: could someone with at least 3 TiVos try having it ignore 2 or more TiVos. If I enter more than one TiVo ignore doesn't seem to actually ignore. I am using commas like the description says and I verified the names on tivo.com


That should be fixed now. I can exclude _both_ my TiVos now! A new zip file has been uploaded, as well as new source committed.


----------



## moyekj

Good stuff from TiVo regarding Season Pass management. See:
http://webcache.googleusercontent.c...article2/0,2817,2370664,00.asp&gs_rfai=&pbx=1


> On Tuesday, TiVo introduced enhancements to its online scheduling for Internet-connected TiVo DVRs.
> 
> While users have long been able to schedule individual programs and Season Pass recordings using a Web browser, the process has always been a one-way affair. Now TiVo users will be able to take more control over their Season Passes on tivo.com or m.tivo.com on mobile phones. Instead of just scheduling Season Passes, users can now reprioritize Season Pass recordings, create several Season Passes at once, delete season passes, or even transfer Season Passes from one TiVo DVR to another.
> 
> Season Pass transfer will help existing TiVo users that buy new TiVo Premiere DVRs transfer their favorite shows from older DVRs like TiVo Series 2, Series 3, and TiVo HD. The Season Pass Manager works with any broadband-connected DVR, and transfers work in both directions. Look for the new Season Pass Manager on tivo.com starting today.


I especially like:
*or even transfer Season Passes from one TiVo DVR to another.*


----------



## orangeboy

moyekj said:


> Good stuff from TiVo regarding Season Pass management. See:
> http://webcache.googleusercontent.c...article2/0,2817,2370664,00.asp&gs_rfai=&pbx=1
> 
> I especially like:
> *or even transfer Season Passes from one TiVo DVR to another.*


Argh! I'm a step or two behind...
I'm curious though why the pcmag article got pulled?


----------



## tomm1079

orangeboy said:


> Argh! I'm a step or two behind...
> I'm curious though why the pcmag article got pulled?


im guessing cause it says "starting today"

but on the other hand your little project here is still great for pulling ToDo list and letting people see how everything lays out for conflicts


----------



## innocentfreak

I have an idea that might be really nice and maybe this is where you are going with this. Now with this article your tool could be even more useful. Depending on when or if we see the season pass manager and the data is able to be scraped, would it be possible to run the season passes against the to do list?

This would give a conflict tool that would catch upcoming conflicts and could be potentially done per TiVo or per multiple TiVos.


----------



## moyekj

Yes, sounds like it will be even more fodder for this project to take advantage of. Presenting conflicts in a more meaningful/clear way rather than wading through the History on each TiVo as innocentfreak pointed out is something I would find useful too.

I'm hoping that the Season Passes can be copied to other TiVos *without* needing associated guide entries for them - i.e. a true Season Pass backup solution. But I think we've learned from TiVo not to get expectations too high...


----------



## innocentfreak

Hopefully we will find out later today.

When someone else gets a chance can they verify an error I am seeing on the newest version. TiVoToDo.v0r2m2

Without changing the default setting or adding a value to minimum number of TiVo to find regardless of how many TiVos it finds, it errors out. If I add a 0 for the default, everything works fine. Sometimes I get network errors unrelated to TiVotodo so I just want to make sure it isn't specific to my network.


----------



## moyekj

FYI, just gave this a go and I'm getting same error as others have reported above (with latest version):


Code:


...
  File "/cygdrive/c/home/TiVoToDo.v0r2m2/tools.py", line 596, in handle_starttag

    c.rdi_schd = a[5]
IndexError: list index out of range

I didn't take the time to dig through the code to try and figure it out but a quick glance reveals it's some issue related to 'recordingOptions' parsing where array is smaller than assumed, but just wanted to add feedback.
NOTE: I have a couple of repeating manual recordings setup that perhaps could be the problem (there probably is not much information about those under 'recordingOptions').


----------



## orangeboy

innocentfreak said:


> Hopefully we will find out later today.
> 
> When someone else gets a chance can they verify an error I am seeing on the newest version. TiVoToDo.v0r2m2
> 
> Without changing the default setting or adding a value to minimum number of TiVo to find regardless of how many TiVos it finds, it errors out. If I add a 0 for the default, everything works fine. Sometimes I get network errors unrelated to TiVotodo so I just want to make sure it isn't specific to my network.


Yeah, my fault for rushing, relating to minimum number of tivos. I'm returning a "string" value, and not an integer value. I now see the error of my ways, and will apply a new modification...


----------



## Allanon

More on TiVo's Season Pass Manager:

http://www.engadget.com/2010/10/13/tivo-launches-online-season-pass-manager/


----------



## orangeboy

moyekj said:


> FYI, just gave this a go and I'm getting same error as others have reported above (with latest version):
> 
> 
> Code:
> 
> 
> ...
> File "/cygdrive/c/home/TiVoToDo.v0r2m2/tools.py", line 596, in handle_starttag
> 
> c.rdi_schd = a[5]
> IndexError: list index out of range
> 
> I didn't take the time to dig through the code to try and figure it out but a quick glance reveals it's some issue related to 'recordingOptions' parsing where array is smaller than assumed, but just wanted to add feedback.
> NOTE: I have a couple of repeating manual recordings setup that perhaps could be the problem (there probably is not much information about those under 'recordingOptions').


I just added a couple manual recording to my boxes. I'll take a look at what those details look like, once they hit the tivo.com To Do List(s).

Edit: It appears that a manual recording *should* have the same info as a WishList or Season Pass recording in the To Do List. The particular string I'm parsing is similar to this, and split at the dots:



Code:


offerId=tivo:of.ctd.121574701.27-2.terrestrial.2010-10-13-21-30-00.1800
        0      | 1 |    2    | 3  |     4     |         5         | 6  |

Where item:
"0" is ignored, not being relevant to me, nor a complete entity,
"1" is ignored, not being relevant to me, nor a complete entity,
"2" represents what I believe is a TiVo index for a particular channel,
"3" represents the human readable channel,
"4" represents either OTA or cable
"5" represents the GMT/UTC airtime, and
"6" represents the show's duration in minutes seconds.

I would think every show *should* have such a string if it shows up in the tivo.com To Do List. I was hoping the "list index out of range" did have something to do with manual recordings, so it could be dealt with in a predictable way. I'll keep working at it...


----------



## innocentfreak

Ok get to work 

https://www3.tivo.com/apps/spm.do


----------



## orangeboy

innocentfreak said:


> Ok get to work
> 
> https://www3.tivo.com/apps/spm.do


It does seem to be a nice location for reaping true Season Passes and their priorities, and not just _anything_ on the ToDo List (Season Passes, ARWLs, Manual Recordings)... :up:

(yep, I already checked the HTML source )


----------



## innocentfreak

So we should have a conflict tool by tomorrow then? lol


----------



## orangeboy

innocentfreak said:


> So we should have a conflict tool by tomorrow then? lol


Um, I'll see what I can do


----------



## orangeboy

orangeboy said:


> moyekj said:
> 
> 
> 
> FYI, just gave this a go and I'm getting same error as others have reported above (with latest version):
> 
> 
> Code:
> 
> 
> ...
> File "/cygdrive/c/home/TiVoToDo.v0r2m2/tools.py", line 596, in handle_starttag
> 
> c.rdi_schd = a[5]
> IndexError: list index out of range
> 
> I didn't take the time to dig through the code to try and figure it out but a quick glance reveals it's some issue related to 'recordingOptions' parsing where array is smaller than assumed, but just wanted to add feedback.
> NOTE: I have a couple of repeating manual recordings setup that perhaps could be the problem (there probably is not much information about those under 'recordingOptions').
> 
> 
> 
> I just added a couple manual recording to my boxes. I'll take a look at what those details look like, once they hit the tivo.com To Do List(s).
> 
> Edit: It appears that a manual recording *should* have the same info as a WishList or Season Pass recording in the To Do List. The particular string I'm parsing is similar to this, and split at the dots:
> 
> 
> 
> Code:
> 
> 
> offerId=tivo:of.ctd.121574701.27-2.terrestrial.2010-10-13-21-30-00.1800
> 0      | 1 |    2    | 3  |     4     |         5         | 6  |
> 
> Where item:
> "0" is ignored, not being relevant to me, nor a complete entity,
> "1" is ignored, not being relevant to me, nor a complete entity,
> "2" represents what I believe is a TiVo index for a particular channel,
> "3" represents the human readable channel,
> "4" represents either OTA or cable
> "5" represents the GMT/UTC airtime, and
> "6" represents the show's duration in minutes seconds.
> 
> I would think every show *should* have such a string if it shows up in the tivo.com To Do List. I was hoping the "list index out of range" did have something to do with manual recordings, so it could be dealt with in a predictable way. I'll keep working at it...
Click to expand...

Well, I'm not real happy about it, but I found out what is causing the "list index out of range" issue, and it is related to the recordingOptions not having items 4, 5 and 6. It's not a showstopper; I'll just have to get that info from the xml that gets parsed.


----------



## innocentfreak

Isn't coding fun lol.

Part of me wishes I had learned it when I started to play back when I was oh 8 or so, and another part of me goes no thanks. 

I still remember writing some form of code that would draw a bottle and then fill it with different color liquids when I ran it. I think I did it on a TRS-80. I probably copied it straight from a book, but I just remember being surprised when it worked lol.


----------



## moyekj

innocentfreak said:


> So we should have a conflict tool by tomorrow then? lol


 Problem is with incomplete data: missing repeat manual recordings, one time recordings, and more importantly ARWLs, there is an accuracy issue. The other problem is pulling guide data for several days worth of programming is not trivial either, and I'm not even sure if there are free sources of xml guide data available these days. Conflict detection is not an easy task by any means even with accurate data. I have personal experience writing such software having written replaySchedule years ago for ReplayTV To Do List + Conflict web page generator.


----------



## innocentfreak

Orangeboy, did those additional reports help any? I didn't know if you wanted me to run it off and on to see if it caught other results to help narrow it down.


----------



## orangeboy

innocentfreak said:


> Orangeboy, did those additional reports help any? I didn't know if you wanted me to run it off and on to see if it caught other results to help narrow it down.


Yes indeed, they did help! I ended up going to Biketoberfest over the weekend, and didn't get a chance to look over the attachment until earlier today.

I'm kind of up in the air about implementing a work-around. The problem stems from when a show doesn't have adequate episode details (what channel, date and time) for the particular To Do List entry being worked on. tivo.com presents only what I would consider "generic" recording options on the show's details page. The work-around I have in mind would utilize the Upcoming Episodes information found on the same page. I believe I could do best-guess at finding the episode details.

My only concern with using this approach is if the show is being aired on more than 1 channel at the particular time, such as when being aired on both an SD and HD channel. The best-guess approach definitely injects a bit of uncertainty about the accuracy of the information presented; the program could produce a result for the show stating that it's being recorded on channel 70, when in actuality it's being recorded on channel 1070.

This could throw a wrench into a "Season Pass Backup" function, which may be irrelevant now with the introduction of tivo.com's Season Pass Manager. I'm not sure of, or tested the limitations of TiVo's SPM, such as disconnecting a TiVo for a period of time, simulating a sudden, catastrophic harddrive failure. If SPM doesn't cache a TiVo's Season Passes for an extended period of time (in order to copy to a new DVR (or replacement drive?)), having a Season Pass Backup could be rather convenient (if the backup was accurate).


----------



## innocentfreak

Cool hope you had fun. I know here it was nice out this weekend which is rare lol.

I wasn't sure if they were useful since it seemed to be saying the same thing just with another show. 

I am definitely curious to see what you can scrape from SPM. Even if you can just scrape the basic info that may be enough for a season pass backup. Then again I guess you could just print a manual list. 
If you limit the to do list from pulling past 7-10 days which is usually where guide data starts to become generic, are you still seeing the error? I know you linked to a post here, but truth be told I have no idea what the errors mean. I am just a guinea pig lol. I wonder if some of it could be easily scraped from zap2it.com, since you can link it to your TiVos to request season passes through them since it is also tribune media. 


Would it be possible to set it so the user could pick the default channel if this came up? I don't know if that would help, but something where the user overrode the choice so it ignored the other channel.


----------



## orangeboy

innocentfreak said:


> Cool hope you had fun. I know here it was nice out this weekend which is rare lol.


I had a great time! My first time in Daytona Beach during a "Bike" event. The weather was great, and I didn't get sunburned!



innocentfreak said:


> I wasn't sure if they were useful since it seemed to be saying the same thing just with another show.


No, it definitely was useful. I'm testing with only my OTA lineup, and wanted to confirm it wasn't isolated to cable lineups only (since I rarely if ever had the problem).



innocentfreak said:


> I am definitely curious to see what you can scrape from SPM. Even if you can just scrape the basic info that may be enough for a season pass backup. Then again I guess you could just print a manual list.


Yep, I'd definitely like to incorporate SPM information. Having a given list of Season Passes to compare to the upcoming To Do List would pinpoint unrealized conflicts. So if you had a Season Pass that wasn't showing up in the To Do List, it would seem there's only one of two causes: Either the show truly isn't airing in the upcoming few days, or Season Passes with higher priorities are preventing the Season Pass from recording. I caught this with Smallville. I missed 2-3 episodes of the new season because a Season Pass I created for a different show (before Smallville resumed) correctly didn't show any conflicts. Once Smallville started airing again, I had no idea of the conflict until I went into my Recording History and found the problem. I expect to increment the version to v1r?m? when SPM gets incorporated. v0 needs to be stable first 



innocentfreak said:


> If you limit the to do list from pulling past 7-10 days which is usually where guide data starts to become generic, are you still seeing the error? I know you linked to a post here, but truth be told I have no idea what the errors mean. I am just a guinea pig lol.


Yeah, that other post showed the error immediately, on the very first show encountered. There was no "Added to cache" message, so the generic show detail seems to happen at any point with the current Guide Data.



innocentfreak said:


> I wonder if some of it could be easily scraped from zap2it.com, since you can link it to your TiVos to request season passes through them since it is also tribune media.


I looked into zap2it, hoping to find some way of detecting whatever API they are using to schedule recordings and/or Season Passes. Nothing really stood out to me as being the method they are using. I'm sure it's all done behind the scenes with their own applications, possibly "talking" to the TiVo scheduling servers (which really makes me think I could/should be targeting the TiVo "mind" servers, instead of the HTML scraping...)



innocentfreak said:


> Would it be possible to set it so the user could pick the default channel if this came up? I don't know if that would help, but something where the user overrode the choice so it ignored the other channel.


Yes. The nice thing about targeting the "Record With Options" link that I've been using is that tivo.com returns a chunk of xml with options (most of which are found in the conf file's Season Pass section), including alternative channels on which the show is airing. The TiVoToDo console display only shows the number of alternative channels, but the TiVoToDo.By.Show.csv produced contains all the channel numbers, call letters, and delivery method (cable/antenna) for alternate airings of the show. I figured gathering all of that information would/could help convert ARWLs into individual Season Passes, if desired. So if an ARWL is picking up episodes on an SD channel, while the remainder of episodes are being picked up on HD channels, Season Passes could be created for the HD channels only, and you could record and watch the programming the way you'd want to.


----------



## innocentfreak

All I know is it just seems like this would be so much easier if TiVo would open up more access via IP assuming it was possible. 

Of course it may not be as fun for you lol.


----------



## orangeboy

innocentfreak said:


> All I know is it just seems like this would be so much easier if TiVo would open up more access via IP assuming it was possible.
> 
> Of course it may not be as fun for you lol.


While I do consider learning a new (or even an old*) programming language fun, I am lazy, and would be much happier working with much more directly with the data, and without having to account for differences in results from the same function calls. In other words, I'd like to consistently and reliably get back the episode details for every show in the To Do List, every time I ask for it. 

*I'm also trying to teach myself mainframe assembler in my spare time.


----------



## orangeboy

innocentfreak said:


> All I know is it just seems like this would be so much easier if TiVo would open up more access via IP assuming it was possible.
> 
> Of course it may not be as fun for you lol.


I asked TiVoMargret/tivodesign if an application programming interface for scheduling would ever be documented and made public:



tivodesign said:


> I don't think so. Probably only to those who sign agreements.


 (I don't know how to link to tweets)


----------



## innocentfreak

Oh well, not that surprising, but still sucks. 

At the same time none of it would be necessary if TiVo would do it themselves. I guess we should be lucky that they have left it open for us even to use tools like KMTTG, PyTiVo and Streambaby.


----------



## innocentfreak

Would it be possible to format the CSV so it displays similar to how it does on the command prompt?

This way you would have the date and time and then a column for each TiVo. In the specific TiVo column it would give show name and channel. 

I figure this would make it easier to see conflicts. This is essentially how you see it on the command prompt on the final screens before exiting.


----------



## orangeboy

innocentfreak said:


> Would it be possible to format the CSV so it displays similar to how it does on the command prompt?
> 
> This way you would have the date and time and then a column for each TiVo. In the specific TiVo column it would give show name and channel.
> 
> I figure this would make it easier to see conflicts. This is essentially how you see it on the command prompt on the final screens before exiting.


That's how the ToDo.By.Date.*.csv files should be. Are you seeing something different?

Edit: I just attached one of my "bad" night's csv, where I have 4 tuners all occupied at 9:00 PM.


----------



## innocentfreak

Didn't check those lol since I forgot about them. It is very close, but it doesn't tell you the show name and instead lists the TiVo so it tells you what TiVos have recording just not what is recording.


----------



## orangeboy

innocentfreak said:


> Didn't check those lol since I forgot about them. It is very close, but it doesn't tell you the show name and instead lists the TiVo so it tells you what TiVos have recording just not what is recording.


Ah yeah. I did have titles showing there at one point (in a debugging capacity) when trying to make the show durations line up correctly. I went the other way with showing DVR names, with the idea of showing which DVR had an open tuner at the time. I found it more visually pleasing as well, since a DVR's name is limited to 16 characters, while a show's title is extremely variable in length (thinking of title like "V" compared to "Law & Order: Special Victims Unit").

I'll take a look at the logic though, and see if I can easily just add a header row with DVR names, and have the column data as the show names...


----------



## innocentfreak

Yeah something like this at the 8 and 9 timeslots where I changed it.

Hmm didn't think about the name of the show length. Even if you just get the first 16 characters that would be good.


----------



## orangeboy

I guess in a csv file, the title length doesn't really matter much. I'll see what I can do!


----------



## innocentfreak

Cool. Hopefully this error is nipped in the bud now with the latest results. Ran it again without a problem for a third time. I need to find a manual recording to add to see if pops an error with a new show.


----------



## orangeboy

New source has been committed, and a new zip is available for download at http://code.google.com/p/tivotodo/

I've also added a new "Enhancement request from user" template to the Issues section. This should help centralize feature requests and help me remember what to work on! 

As always, let me know of any problems encountered.


----------



## innocentfreak

Suggestions? what are those?

Also make sure you delete you shows.cache before trying the new version otherwise you might see the same errors as before


----------



## moyekj

Thanks for continued work on this.
2 problems for me (using latest version):
1. A crash in "Viewing Shows" section:


Code:


Viewing Shows. Press Enter to continue

Traceback (most recent call last):
  File "TiVoToDo.py", line 229, in <module>
    next_time))
  File "C:\home\Tivo\TiVoToDo.v0r2m4\tools.py", line 113, in tivo_tuners
    dur1 = ' ({0})'.format(c.tuners[k][1])
AttributeError: 'str' object has no attribute 'format'

2. Show times are not correct for a bunch of shows on 1 TiVo ("S3"). Below is a snippet from ToDoAll.csv. Note several airings at 4-5:00am on "S3" TiVo which is not right. Looks like the "Premiere" TiVo listings do have correct times:


Code:


Date,Weekday,Time,TiVo Name,Channel,Show Title,Duration
10/24,Sun,9:00 pm,Premiere,707 KABCDT,Desperate Housewives,61
10/24,Sun,10:01 pm,Premiere,707 KABCDT,Brothers & Sisters,59
,,,,
10/25,Mon,3:59 am,S3,702 KCBSDT,The Amazing Race 17,60
10/25,Mon,5:00 pm,Premiere,746 FNCHD,The O'Reilly Factor,60
10/25,Mon,8:00 pm,Premiere,707 KABCDT,Dancing With the Stars,121
,,,,
10/26,Tue,3:59 am,S3,702 KCBSDT,How I Met Your Mother,30
10/26,Tue,3:59 am,S3,704 KNBCDT,Chuck,60
10/26,Tue,4:29 am,S3,702 KCBSDT,Rules of Engagement,30
10/26,Tue,4:59 am,S3,702 KCBSDT,Two and a Half Men,31
10/26,Tue,4:59 am,S3,704 KNBCDT,The Event,60
10/26,Tue,5:30 am,S3,702 KCBSDT,Mike & Molly,29
10/26,Tue,5:59 am,S3,704 KNBCDT,Chase,60
10/26,Tue,5:59 am,S3,702 KCBSDT,Hawaii Five-0,60
10/26,Tue,5:00 pm,Premiere,746 FNCHD,The O'Reilly Factor,60
10/26,Tue,9:00 pm,Premiere,707 KABCDT,Dancing With the Stars,121
10/26,Tue,9:00 pm,Premiere,711 KTTVDT,Raising Hope,60
,,,,
10/27,Wed,1:59 am,S3,761 SYFYHD,Stargate Universe,60
10/27,Wed,2:59 am,S3,761 SYFYHD,Caprica,60
10/27,Wed,3:29 am,S3,718 TNTPHD,NBA Basketball,150
10/27,Wed,5:59 am,S3,702 KCBSDT,The Good Wife,60
10/27,Wed,5:00 pm,Premiere,746 FNCHD,The O'Reilly Factor,60
10/27,Wed,9:00 pm,Premiere,707 KABCDT,Modern Family,31
10/27,Wed,10:00 pm,Premiere,749 MTVPHD,The Challenge: Cutthroat,60
10/27,Wed,10:01 pm,Premiere,707 KABCDT,The Whole Truth,59


----------



## innocentfreak

Probably a stupid question, but did you double check tivo.com to see what they show for those shows on your S3 to see if it is pulling incorrectly or if TiVo.com has it incorrect?

I don't have a S3 so I haven't seen it myself. I don't see it on the TiVo HD though.


----------



## tomm1079

innocentfreak said:


> Didn't check those lol since I forgot about them. It is very close, but it doesn't tell you the show name and instead lists the TiVo so it tells you what TiVos have recording just not what is recording.


I just ask him for this to in a PM. Glad im not the only one


----------



## orangeboy

moyekj said:


> Thanks for continued work on this.
> 2 problems for me (using latest version):
> 1. A crash in "Viewing Shows" section:
> 
> 
> Code:
> 
> 
> Viewing Shows. Press Enter to continue
> 
> Traceback (most recent call last):
> File "TiVoToDo.py", line 229, in <module>
> next_time))
> File "C:\home\Tivo\TiVoToDo.v0r2m4\tools.py", line 113, in tivo_tuners
> dur1 = ' ({0})'.format(c.tuners[k][1])
> AttributeError: 'str' object has no attribute 'format'


Is your python install pre-2.6? I just read that "format method was introduced in python 3.0 and backported only to 2.6". I can change that to the old format of formatting strings.

If you wanted to do a quick local mod to the code, I just tried the following and had success:

(starting at line 109 of tools.py)


Code:


        # Nullify any names for free tuners
        if c.tuners[k][1] == 0:
            dur1 = ''
        else:
            dur1 = ' (%s)' % str(c.tuners[k][1])
        if c.tuners[k][5] == 0:
            dur2 = ''
        else:
            dur2 = ' (%s)' % str(c.tuners[k][5])




moyekj said:


> 2. Show times are not correct for a bunch of shows on 1 TiVo ("S3"). Below is a snippet from ToDoAll.csv. Note several airings at 4-5:00am on "S3" TiVo which is not right. Looks like the "Premiere" TiVo listings do have correct times:
> 
> 
> Code:
> 
> 
> Date,Weekday,Time,TiVo Name,Channel,Show Title,Duration
> 10/24,Sun,9:00 pm,Premiere,707 KABCDT,Desperate Housewives,61
> 10/24,Sun,10:01 pm,Premiere,707 KABCDT,Brothers & Sisters,59
> ,,,,
> 10/25,Mon,3:59 am,S3,702 KCBSDT,The Amazing Race 17,60
> 10/25,Mon,5:00 pm,Premiere,746 FNCHD,The O'Reilly Factor,60
> 10/25,Mon,8:00 pm,Premiere,707 KABCDT,Dancing With the Stars,121
> ,,,,
> 10/26,Tue,3:59 am,S3,702 KCBSDT,How I Met Your Mother,30
> 10/26,Tue,3:59 am,S3,704 KNBCDT,Chuck,60
> 10/26,Tue,4:29 am,S3,702 KCBSDT,Rules of Engagement,30
> 10/26,Tue,4:59 am,S3,702 KCBSDT,Two and a Half Men,31
> 10/26,Tue,4:59 am,S3,704 KNBCDT,The Event,60
> 10/26,Tue,5:30 am,S3,702 KCBSDT,Mike & Molly,29
> 10/26,Tue,5:59 am,S3,704 KNBCDT,Chase,60
> 10/26,Tue,5:59 am,S3,702 KCBSDT,Hawaii Five-0,60
> 10/26,Tue,5:00 pm,Premiere,746 FNCHD,The O'Reilly Factor,60
> 10/26,Tue,9:00 pm,Premiere,707 KABCDT,Dancing With the Stars,121
> 10/26,Tue,9:00 pm,Premiere,711 KTTVDT,Raising Hope,60
> ,,,,
> 10/27,Wed,1:59 am,S3,761 SYFYHD,Stargate Universe,60
> 10/27,Wed,2:59 am,S3,761 SYFYHD,Caprica,60
> 10/27,Wed,3:29 am,S3,718 TNTPHD,NBA Basketball,150
> 10/27,Wed,5:59 am,S3,702 KCBSDT,The Good Wife,60
> 10/27,Wed,5:00 pm,Premiere,746 FNCHD,The O'Reilly Factor,60
> 10/27,Wed,9:00 pm,Premiere,707 KABCDT,Modern Family,31
> 10/27,Wed,10:00 pm,Premiere,749 MTVPHD,The Challenge: Cutthroat,60
> 10/27,Wed,10:01 pm,Premiere,707 KABCDT,The Whole Truth,59


Well, that's not good at all! 
Could you go to the To Do List page and copy/paste the correct times for those shows (here, PM, or in an issue - I'm easy)?


----------



## innocentfreak

tomm1079 said:


> I just ask him for this to in a PM. Glad im not the only one


I added it to the enhancements page.


----------



## moyekj

orangeboy said:


> Is your python install pre-2.6? I just read that "format method was introduced in python 3.0 and backported only to 2.6". I can change that to the old format of formatting strings.
> 
> If you wanted to do a quick local mod to the code, I just tried the following and had success:
> 
> (starting at line 109 of tools.py)
> 
> 
> Code:
> 
> 
> # Nullify any names for free tuners
> if c.tuners[k][1] == 0:
> dur1 = ''
> else:
> dur1 = ' (&#37;s)' % str(c.tuners[k][1])
> if c.tuners[k][5] == 0:
> dur2 = ''
> else:
> dur2 = ' (%s)' % str(c.tuners[k][5])


Yes, using 2.5 (at one point pyTivo didn't work with 2.6 or later - don't know if that has changed). That modification fixed the problem.



> Well, that's not good at all!
> Could you go to the To Do List page and copy/paste the correct times for those shows (here, PM, or in an issue - I'm easy)?


What do you know, the times are all messed up on TiVo web site as well for the S3. It's like they have the wrong timezone for my S3 somehow... Oh well. It used to be correct a few days ago. I think the messed up times coincide with a software update on the S3. To Do list on the S3 DVR itself looks correct though.


----------



## orangeboy

moyekj said:


> Yes, using 2.5 (at one point pyTivo didn't work with 2.6 or later - don't know if that has changed). That modification fixed the problem.


Great! I'll work that into the next release so it will be compatible with your installation without local mods. I'm a bit back-leveled with python on my server running pyTivo, but it's at 2.6.3.



moyekj said:


> What do you know, the times are all messed up on TiVo web site as well for the S3. It's like they have the wrong timezone for my S3 somehow... Oh well. It used to be correct a few days ago. I think the messed up times coincide with a software update on the S3. To Do list on the S3 DVR itself looks correct though.


That's good the DVR (where it counts) has the correct times! I'm still at 11.0h software on my S3, so I'll have to check the times if/when it gets the latest 11.0j. I asked TiVoMargret/Tivodesign on Twitter if the DVR's To Do List would ever be available "locally" like the NPL, but I didn't get a response yet.

Anyway, I'm glad it's working for you (sorta/kinda). While I do enjoy problem solving, I've been wanting to get out of "bug-fix" mode, and start trying to incorporate the SPM and Search pages into the mix, so I can start detecting Season Pass conflicts. With the full list of Season Passes now available, I should be able to compare what Season Pass shows are _not_ in the To Do List, but should be. I mentioned the tivo.com Search page as well, because there's an option to check for First Run Only (the actual option is &repeat=false). I'm thinking this would be a good way to verify that a Season Pass show is actually in the Guide Data or not.


----------



## orangeboy

innocentfreak said:


> ...It is very close, but it doesn't tell you the show name and instead lists the TiVo so it tells you what TiVos have recording just not what is recording.





tomm1079 said:


> I just ask him for this to in a PM. Glad im not the only one


Done. See TiVoToDo.v0r2m5.zip at http://code.google.com/p/tivotodo/downloads/list.


----------



## innocentfreak

Definitely works well. It might need a little tweaking if possible. One thing I noticed which may be due to show title length which would make it possibly unavoidable. 

It adds spaces around the various shows and TiVos so you can't autofit the columns. Unlike the other CSVs where the commas come right before and after each item this results with multiple spaces on both sides.


----------



## orangeboy

innocentfreak said:


> Definitely works well. It might need a little tweaking if possible. One thing I noticed which may be due to show title length which would make it possibly unavoidable.
> 
> It adds spaces around the various shows and TiVos so you can't autofit the columns. Unlike the other CSVs where the commas come right before and after each item this results with multiple spaces on both sides.


Yes, I pad the show title to the longest show title width + the longest duration width. When using a monospaced/fixed width font in excel, the resulting column widths are all the same.


----------



## innocentfreak

Did you try without the fixed width so the column was only as large as the largest show if necessary? 

With 3 TiVos and at least one long title, it doesn't even fit on my screen. It not it isn't a big deal.

EDIT: just noticed it looks like it chokes on SNL. 

It shows 11:00 PM on Saturday night which I assume it is due to the 11:29 starting time so that is fine. It shows it then at midnight, but not at 12:30. 

Also it is then repeating Sunday at noon skips 12:30 pm and then again at 1:00 pm and 1:30 pm. I am guessing it is re-listing the 11:30 PM showing from Saturday night, because I don't have any SNL recording scheduled at noon on Sunday.


----------



## orangeboy

TiVoToDo.v0r2m6.zip backs out any show title padding.


----------



## innocentfreak

Thanks that works much better for me. Hopefully everyone else agrees.


----------



## moyekj

Looks like web site now has correct times for my "S3" unit again and now latest version runs through without errors.
I'm trying to figure out if there is an obvious output to look at for conflicts, since that is the most useful output for me? For example I know that this coming Tuesday night there is an NBA game that will not record on my Premiere unit due to tuners being busy with 2 other shows, but I didn't see anything obvious in the output files to point that out? So I take it conflict detection is not yet coded in right?


----------



## innocentfreak

I think he is waiting before he incorporates the SPM scraping. I know he has been focused on getting the manual and single recording bugs worked out first before adding more features. 

The only way I can think of to check and see is via the various by day output files since this lets you see what the tuners are tied up with. Of course this means you also have to know what else airs at the time.


----------



## orangeboy

moyekj said:


> Looks like web site now has correct times for my "S3" unit again and now latest version runs through without errors.
> I'm trying to figure out if there is an obvious output to look at for conflicts, since that is the most useful output for me? For example I know that this coming Tuesday night there is an NBA game that will not record on my Premiere unit due to tuners being busy with 2 other shows, but I didn't see anything obvious in the output files to point that out? So I take it conflict detection is not yet coded in right?


In the output folder, there should be a file named ToDo.By.Date.10-26.Tue.csv. That should show you what the tuners are doing during the game.


----------



## moyekj

innocentfreak said:


> I think he is waiting before he incorporates the SPM scraping. I know he has been focused on getting the manual and single recording bugs worked out first before adding more features.
> 
> The only way I can think of to check and see is via the various by day output files since this lets you see what the tuners are tied up with. Of course this means you also have to know what else airs at the time.


 It's something that TiVo really should be doing as well as part of web site. All they really need to do instead of figuring out if there are conflicts is simply download conflict information from TiVo to display as well, the advantage being that they can use different icons for different reasons why shows won't record which would make it real easy to pick out genuine conflicts that may require action. Right now going through Recording History on each TiVo is too painful since there are so many shows not recording because they are repeats. They could possibly even take it a step further and offer to automatically schedule such shows in conflict on another TiVo in your house if there is an open slot available somewhere.

The problem right now trying to program for conflict detection of course is lack of information on Wishlists and Repeat recordings in SPM at web site. Very often for me it is Wishlists that I setup as lowest priority and most likely not to record if there are conflicts, so those are the ones I'd like to figure out when will not record.
Perhaps a workaround to that problem is allow in configuration of this program to manually specify Wishlist and Repeat recording season passes (and their priority number). Still, I know by personal experience accurate conflict detection is going to be hard to program, especially since one needs to scrape guide listings for many digital channels for several days which is a lot of information to process.


----------



## orangeboy

I should clarify my last post - If you are running the latest latest version (version 0 release 2 modification 6), reviewing that csv file should show you what _shows_ are airing during the game.


----------



## moyekj

orangeboy said:


> In the output folder, there should be a file named ToDo.By.Date.10-26.Tue.csv. That should show you what the tuners are doing during the game.


 Understood. The issue of course is I would have to know in advance there is a game on Tuesday overlapping those specific time slots. In this example I do know, but of course in general the best case be for a program to point it out and even email me in advance about any conflicts. This may be well beyond the scope of what you are trying to do with this program though.


----------



## orangeboy

moyekj said:


> It's something that TiVo really should be doing as well as part of web site. All they really need to do instead of figuring out if there are conflicts is simply download conflict information from TiVo to display as well, the advantage being that they can use different icons for different reasons why shows won't record which would make it real easy to pick out genuine conflicts that may require action. Right now going through Recording History on each TiVo is too painful since there are so many shows not recording because they are repeats. They could possibly even take it a step further and offer to automatically schedule such shows in conflict on another TiVo in your house if there is an open slot available somewhere.
> 
> The problem right now trying to program for conflict detection of course is lack of information on Wishlists and Repeat recordings in SPM at web site. Very often for me it is Wishlists that I setup as lowest priority and most likely not to record if there are conflicts, so those are the ones I'd like to figure out when will not record.
> Perhaps a workaround to that problem is allow in configuration of this program to manually specify Wishlist and Repeat recording season passes (and their priority number). Still, I know by personal experience accurate conflict detection is going to be hard to program, especially since one needs to scrape guide listings for many digital channels for several days which is a lot of information to process.


I agree. One of the inspirations for starting a project like this was I was wondering why Smallville wasn't recording. I had a Season Pass for it for the past couple of years, and never had problems before. A couple months ago, I created an ARWL that at the time of creation indicated no conflicts, because the Smallville season hadn't started. Fast forward a week or three when the Smallville season resumes, and I still get no recordings. I hardly ever review recording history; I never really needed to in the past. Yeah, I think adding in SPM and Search pages will help detecting conflicts, and finding a way to utilize the hyperlinks that can be created could go a long way.


----------



## orangeboy

moyekj said:


> Understood. The issue of course is I would have to know in advance there is a game on Tuesday overlapping those specific time slots. In this example I do know, but of course in general the best case be for a program to point it out and even email me in advance about any conflicts. This may be well beyond the scope of what you are trying to do with this program though.


Sorry, I had missed your very last sentence in the other post. Correct, conflict detection has yet to be implemented. ARWLs and Single/Explicit recordings will be hard if not impossible to detect given the current state of tivo.com and/or local access to the TiVo DVR's schedule.

TiVo has all the pieces. They're just not doing things with them quickly enough? SPM seems to be the first effort in awhile. I'd like to see it available on the DVR though.


----------



## innocentfreak

moyekj said:


> It's something that TiVo really should be doing as well as part of web site. All they really need to do instead of figuring out if there are conflicts is simply download conflict information from TiVo to display as well, the advantage being that they can use different icons for different reasons why shows won't record which would make it real easy to pick out genuine conflicts that may require action. Right now going through Recording History on each TiVo is too painful since there are so many shows not recording because they are repeats. They could possibly even take it a step further and offer to automatically schedule such shows in conflict on another TiVo in your house if there is an open slot available somewhere.
> 
> The problem right now trying to program for conflict detection of course is lack of information on Wishlists and Repeat recordings in SPM at web site. Very often for me it is Wishlists that I setup as lowest priority and most likely not to record if there are conflicts, so those are the ones I'd like to figure out when will not record.
> Perhaps a workaround to that problem is allow in configuration of this program to manually specify Wishlist and Repeat recording season passes (and their priority number). Still, I know by personal experience accurate conflict detection is going to be hard to program, especially since one needs to scrape guide listings for many digital channels for several days which is a lot of information to process.


I 100% agree. Things like this are exactly things that TiVo should be working on for added functionality, but look how long it took for them to incorporate an online Season Pass Manager when there was a hack to allow it back on the series 1.

I really questions sometimes what TiVo is or isn't thinking. You can't tell me someone at TiVo hasn't had similar ideas like we have.

If TiVo isn't going to do it, at least give us the access and info so that users such as you, wmcbrine, and orangeboy can make useful tools to give us the necessary functionality.


----------



## moyekj

orangeboy said:


> Sorry, I had missed your very last sentence in the other post. Correct, conflict detection has yet to be implemented. ARWLs and Single/Explicit recordings will be hard if not impossible to detect given the current state of tivo.com and/or local access to the TiVo DVR's schedule.
> 
> TiVo has all the pieces. They're just not doing things with them quickly enough? SPM seems to be the first effort in awhile. I'd like to see it available on the DVR though.


 Yes, just a quick enhancement to the Recording History on DVR itself where it uses different icons for different reasons a show will not record would be an easy way to make that list a lot easier to pick out real conflicts that you care about. TiVo already did just that for the Comcast/TiVo implementation which makes it that much more of a mystery why Premiere units didn't get that kind of enhancement. Or even just a simple filter where we can tell it to exclude shows that won't record because of 28 day rule of not recording repeats, etc. Or even just a quick option to show me just for the current day what shows will not record and why. It wouldn't take much more effort to make that list so much more useful/easy to read.

I did implement a strategy recently where I identified channels I record from the most and split them up evenly between my 2 TiVos. i.e. 2 most recorded channels on 1 TiVo, 2 most recorded on the other. This helps minimize conflicts but there are still several times during the year for me especially with NBA in season where I still get conflicts I need to resolve (and in some cases I have to resort to recording least wanted conflicting show on an old ReplayTV which I use as additional emergency tuner). There have been times when even 5 tuners weren't enough and I had to use my wife's ReplayTV for a 6th recording... but that is pretty rare these days now that a lot of shows I used to watch have been canceled.


----------



## orangeboy

Well, I've got a local copy of both an SPM page and Search page that I've been looking at.


----------



## orangeboy

A somewhat off-topic question regarding svn: Do you keep a single working copy that you always work on, or do you have more than one? At the moment, I have two: One for distribution that is clear of any local modification (specifically a "clean" conf file, and no pyc files), and one that I make mods to the py files. I copy the py files to my "dist" working copy and commit those. I've used svn update to refresh the non-distribution working copy, but I think that brought in some unexpected changes? My request.py file had an extra import statement added between revision 9 and revision 11. I'm fairly new to svn, with having more practice with IBM's SMP/E...


----------



## moyekj

I only use 1 working area and use "svn status" all the time to get list of what is locally modified, and sometimes "svn diff <filename>" to list differences between local copy and repository as a reminder of what I changed. I then usually commit each file with changes separately with appropriate comments for each about the changes.
Very often the repository will contain source code newer than the last released version I released for kmttg. As long as the "Downloads" has the releases you want people to use there is no reason to keep the repository source in sync with latest release, especially in your case where the source files are the released files anyway (no compiling needed). If someone wants the source for a particular release then just download that release.

NOTE: I do have different working copies on different computers and will often commit changes made in one working area so I can update (svn update) a different working area to continue working there.


----------



## orangeboy

Thanks K! That's a good idea about committing each file instead of the whole shebang. I want to get into good habits and not bad ones early on.


----------



## orangeboy

Just a heads up: As I learn more about the capabilities of python, I'm finding ways to improve date/time handling that is fairly important when related to scheduling information, such as the TiVo To Do list. With that being said, another bug was found relating to a show spanning from one day to the next (an example would be Saturday Night Live). I'm pretty sure it's caused by the primitive methods I used to manipulate and use the date/times found on the tivo.com site. So if you see anomalous entries for shows in different timeslots than expected, I should have a fix in before too long. Most shows should be unaffected.

Edit: My reference to "before long" regarding a fix is relative. I'm going to have to overhaul several modules. I'd say keep using the latest release, and report any bugs encountered, or any enhancements you'd like to see. Thanks!


----------



## orangeboy

orangeboy said:


> Just a heads up: As I learn more about the capabilities of python, I'm finding ways to improve date/time handling that is fairly important when related to scheduling information, such as the TiVo To Do list. With that being said, another bug was found relating to a show spanning from one day to the next (an example would be Saturday Night Live). I'm pretty sure it's caused by the primitive methods I used to manipulate and use the date/times found on the tivo.com site. So if you see anomalous entries for shows in different timeslots than expected, I should have a fix in before too long. Most shows should be unaffected.
> 
> Edit: My reference to "before long" regarding a fix is relative. I'm going to have to overhaul several modules. I'd say keep using the latest release, and report any bugs encountered, or any enhancements you'd like to see. Thanks!


Due to this bug, I've changed the way I (internally) store the gathered information from the various tivo.com web pages. Because of this change, I now need to rework the logic that creates the output, and I'm now curious as to which output seems the most relevant. So now I'm here to find out what you good folks want to see!

Should I bother to rework:


ToDo.All.csv? - A list of all DVR To Do Lists, sorted by date/time
ToDo.By.Show.csv? - A list of all the shows found, sorted by title
ToDo.By.TiVo.csv? - A list of individual DVR To Do Lists, sorted by TiVo name
ToDo.By.Date.<date>.csv? - A table of all DVRs tuner activity for a given date

I'm guessing that ToDo.By.Date.<date>.csv is probably the most useful, while the others serve more as curiosity satisfiers. What are your thoughts?

Thanks for any input!


----------



## SeanC

I only have 1 Tivo so the answer for me is real simple. ToDo.All.csv is what I look at 99.9&#37; of the time.


----------



## innocentfreak

I think I would rank them in this order.

ToDo.By.Date.<date>.csv
ToDo.All.csv
ToDo.By.Show.csv
ToDo.By.TiVo.csv

I would almost say Show might be above All for me since it is a nice way to easily look at all the shows recording rather than searching the various timeslots.


----------



## orangeboy

SeanC said:


> I only have 1 Tivo so the answer for me is real simple. ToDo.All.csv is what I look at 99.9% of the time.





innocentfreak said:


> I think I would rank them in this order.
> 
> ToDo.By.Date.<date>.csv
> ToDo.All.csv
> ToDo.By.Show.csv
> ToDo.By.TiVo.csv
> 
> I would almost say Show might be above All for me since it is a nice way to easily look at all the shows recording rather than searching the various timeslots.


Poll closed!
I've decided to rework all of the existing reports, and rework the "output" section in the conf file to allow the user to select which reports to produce. Something like:



Code:


[output]
csv = By Date, By Show
display = All, By Tivo

where: 'csv =' and 'display =' could be any combination of the report types (or blank) instead of just 'True' or 'False'. These options will be independent of each other, and should cut back on unwanted files or displays. It's all about the options!


----------



## innocentfreak

Yay options


----------



## orangeboy

It appears that TiVo has implemented some "click tracking" to their webpages, but did a poor job of it. I've been seeing this error:



Code:


HTMLParser.HTMLParseError: bad end tag: "</s'+'cript>", at line 1938, column 194

initially on the login page, and then later in the "Recording options" pages.

If you want, you can edit request.py to change this:



Code:


    else:
        c.result = handle.read()
        parser.feed(c.result)
        parser.close()
        parser.reset()

to this kludgey fix*:


Code:


    else:
        c.result = handle.read().replace('"big"', "'big'").replace('"ludacris"', "'ludacris'").replace("'+'", "")
        parser.feed(c.result)
        parser.close()
        parser.reset()

I'm sure there are more elegant solutions, but this will have to do for now.

*The "big" replacement fixes some bad HTML in an episode's detail page for the show "Criminal Minds", the "ludacris" replacement fixes a "Saturday Night Live" problem, and the "+" replacement was described above.


----------



## innocentfreak

Anyone else seeing on the ByShow.CSV that the season passes are showing the wrong channel? On mine it is pulling occasionally the SD channel rather than the HD channel the season pass is set for. I believe it is also showing this on the other reports with channel numbers also.

Orangeboy is aware of it but I didn't know if it was affecting anyone else to narrow down why.


----------



## tomm1079

sorry i have not been able to help you guys test this. The box i run it on (my windows home server) crashed and i am waiting for replacement parts from newegg. Should have it sometime in next few days


----------



## orangeboy

tomm1079 said:


> sorry i have not been able to help you guys test this. The box i run it on (my windows home server) crashed and i am waiting for replacement parts from newegg. Should have it sometime in next few days


No problem. Sorry to hear about that box crash! Anytime entropy has it's way is frustrating. Hopefully you didn't lose any data...

There are a couple of outstanding bugs I'm trying to work through regarding proper channel selection and shows that span the midnight hour, so the program still isn't quite ready for primetime yet.


----------



## tomm1079

im back!

And now im having an issue....

I figured i needed the latest version so i just installed it and i get this:



Code:


D:\shares\Web\TiVoToDo>TiVoToDo.py
Scanning for TiVos...  and found 3: Computer Room HD Front Room HD Bedroom HD
Logging in...
Traceback (most recent call last):
  File "D:\shares\Web\TiVoToDo\TiVoToDo.py", line 56, in <module>
    r.request_url(url, parser, login_data)
  File "D:\shares\Web\TiVoToDo\request.py", line 31, in request_url
    parser.feed(c.result)
  File "C:\Python27\lib\HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "C:\Python27\lib\HTMLParser.py", line 150, in goahead
    k = self.parse_endtag(i)
  File "C:\Python27\lib\HTMLParser.py", line 317, in parse_endtag
    self.error("bad end tag: %r" % (rawdata[i:j],))
  File "C:\Python27\lib\HTMLParser.py", line 115, in error
    raise HTMLParseError(message, self.getpos())
HTMLParser.HTMLParseError: bad end tag: "</s'+'cript>", at line 2432, column 194

My previous version does not run anymore either...same error.


----------



## innocentfreak

Try deleting your shows.cache file and running again.


----------



## tomm1079

innocentfreak said:


> Try deleting your shows.cache file and running again.


same thing...


----------



## innocentfreak

I know I was getting that error before and I thought he tracked it down. I wonder if he hasn't updated it in the posted version yet.

I am running the SVN version and I am not getting the error.


----------



## tomm1079

That did it. I just pulled down the latest version and it is running now. 

Thanks for the suggestion


----------



## innocentfreak

Yeah the new version has a few things he is still testing and working on, and make sure you double check the options since it has different options. I believe he is having an issue with clipping enabled currently where the reports aren't 100% accurate.


----------



## tomm1079

i love the new options...going to see if i can webify the csv files


----------



## orangeboy

Hey - yeah, sorry I didn't respond in a timely manner. I just got back from a short trip south to visit my sister on her birthday. Good times. But yes, as innocentfreak mentioned, the latest svn revision takes care of the (known) malformed html, and adds/modifies a few options in the TiVoToDo.conf file. I'm hoping the examples in the conf file are descriptive enough for now to get by with, until I can get a wiki page or some other type of documentation together to better explain what the options do.

I think if I can track down and fix that bug relating to "clipping = enabled" and shows that span the midnight hour, I'll be able to package up a zip file for download instead of having to resort to pulling the svn revisions. But if y'all are comfortable pulling svn, have at it! 

I've been testing mainly with python 2.6.6, but before I do package up a zip, I'll run it with versions 2.5.4 through 2.7 to make sure it works.


----------



## orangeboy

tomm1079 said:


> i love the new options...going to see if i can webify the csv files


Yep, webify, make an HME app, whatever! 

I haven't worked on it much the past couple of days, so the TiVo Lineup csv(s) aren't configured yet as a reporting option that can be turned on or off, so at present, they're just getting produced every time the program is run. There are a couple of other things I need to fine tune, specifically relating to 3-5 minute "recap" episodes that may or may not associate the correct duration to a show. But good amount of the bugs (I think) have been worked out due to innocentfreak's help with testing the different scenarios that can occur.

If you encounter anything that looks out of the ordinary, feel free to create an issue here: http://code.google.com/p/tivotodo/issues/list, or if you just have a question about one of the conf file options, I'll try my best to explain what it means, or how I intended it's use.


----------



## innocentfreak

I didn't want to add it as a suggestion since I wasn't sure if it was even possible. 

I didn't know if it was possible to either create a CSV of all season passes so of course scraping SPM would need to be implemented. The CSV would be similar to the By Show CSV but also list the date and time the show runs on that channel. 

For example 
How I Met Your Mother - Duration - SP ch# - Day - Time

Ultimately I plan to make my own TV guide will all my season passes just at a glance so I can easily work out what shows I want on what TiVo and in what priority. Of course if you wanted to implement this in its own By Date CSV I wouldn't complain either .


----------



## orangeboy

innocentfreak said:


> I didn't want to add it as a suggestion since I wasn't sure if it was even possible.
> 
> I didn't know if it was possible to either create a CSV of all season passes so of course scraping SPM would need to be implemented. The CSV would be similar to the By Show CSV but also list the date and time the show runs on that channel.
> 
> For example
> How I Met Your Mother - Duration - SP ch# - Day - Time
> 
> Ultimately I plan to make my own TV guide will all my season passes just at a glance so I can easily work out what shows I want on what TiVo and in what priority. Of course if you wanted to implement this in its own By Date CSV I wouldn't complain either .


At present, the only information I can collect from SPM:

(taken from config.py, so ignore the '= None')


Code:


spm_chan = None     # Season Pass channel
spm_prty = None     # Season Pass priority
spm_sIds = None     # Season Pass ID
spm_titl = None     # Season Pass title

To get the other fields, Duration, Day, and Time, I'd have to either cross reference the Title and Channel against the To Do List data (I'm planning to do) or if not found there due to a conflict, get the information from a Title search using http://www3.tivo.com/tivo-tco/search/simple.do?dispatch=simplesearch (also something I'm planning to do).

But of course it gets complicated, what with the different recording options for Season Pass setup, such as First Run Only, First Run and Repeats, and All with Duplicates, which those recording options would influence the search criteria if the show wasn't found in the To Do List. Since each Season Pass can have it's own unique recording option set, I don't think a global option in the conf file would suffice.

However, I could ask what recording option is being used for each Season Pass found on the SPM page, and store that value for subsequent runs of the program (similar to Shows.cache), and only ask for a recording option if a Season Pass gets added since the last run of the program.


----------



## innocentfreak

For this, I wouldn't care about the season pass settings so couldn't you just use new airings for all searches?. I just want to know the primary timeslot and day for each show. I wouldn't care about when the show repeats for example. 

It just saves me from manually looking each show up to go Stargate Universe is Tuesdays at 9:00 on ch# 680, HIMYM is Mondays at 8:00 on Ch# 510, etc. I really don't care when Stargate repeats.


----------



## orangeboy

innocentfreak said:


> For this, I wouldn't care about the season pass settings so couldn't you just use new airings for all searches?. I just want to know the primary timeslot and day for each show. I wouldn't care about when the show repeats for example.
> 
> It just saves me from manually looking each show up to go Stargate Universe is Tuesdays at 9:00 on ch# 680, HIMYM is Mondays at 8:00 on Ch# 510, etc. I really don't care when Stargate repeats.


Should be doable, but I'll need to create another HTMLParser class for the search results. Bug fix first though! I really need the "clipping = Enabled" to function correctly before I get distracted with adding new stuff in.

It might be a bit selfish on my part, but I want to use this program with my clipping option, too!


----------



## innocentfreak

orangeboy said:


> Should be doable, but I'll need to create another HTMLParser class for the search results. Bug fix first though! I really need the "clipping = Enabled" to function correctly before I get distracted with adding new stuff in.
> 
> It might be a bit selfish on my part, but I want to use this program with my clipping option, too!


This is why I threw it out there for discussion first rather than an enhancement on the code page.  I figured it would be a ways off and after SPM implementation.

If you just turn clipping off, you wouldn't need to worry about it.  This is what the cool people do.


----------



## tomm1079

any setting i can do that will disable all console output...i want to run this in a windows task


----------



## innocentfreak

Did you try the display = none in the config file?


----------



## orangeboy

tomm1079 said:


> any setting i can do that will disable all console output...i want to run this in a windows task


I have made some advances, but I've been wrestling with getting some Overlap Protection/Clipping options to work correctly. So a new version hasn't been released yet. However, if you are familiar with svn and subversion, you can "check out" the latest revision here, which includes a conf file option for selected output types:



Code:


[output]
csv = 
# csv = All                         ; Default setting. Will produce all report type csv files.
# csv = None                        ; No csv files will be created. Not to be used with any other option.
# csv = Date                        ; Produce combined To Do Lists of all HD TiVo DVRs, sorted by date.
# csv = Show                        ; Produce a combined list of all shows from HD DVRs
# csv = TiVo                        ; Produce combined To Do Lists of all HD TiVo DVRs, sorted by TiVo name.
# csv = Tuner                       ; Produce all HD TiVo DVR tuner activity. 
# csv = Date, Show, TiVo, Tuner     ; Same as All.

display = 
# display = All                     ; Default setting. Will display all report types on the console.
# display = None                    ; No console reports will be displayed. Not to be used with any other option.
# display = Date                    ; Display combined To Do Lists of all HD TiVo DVRs, sorted by date.
# display = Show                    ; Display a combined list of all shows from HD DVRs
# display = TiVo                    ; Display combined To Do Lists of all HD TiVo DVRs, sorted by TiVo name.
# display = Tuner                   ; Display all HD TiVo DVR tuner activity. 
# display = Date, Show, TiVo, Tuner ; Same as All

Setting "display = None" would produce the results that you want, with no prompting except for when the script completes. To disable even that last prompt, you could delete the second to last line:


Code:


x = raw_input("\nDone! Press Enter to exit")

I imagine you could delete the last 2 lines, with exit() being implied.
Let me know if this works for you. If you don't have an svn client, I could zip up the latest revision to make it more easily available.


----------



## tomm1079

i already had a version from a few days ago but thanks for the offer. I had none set already. Just needed to remove the exit line. 

Thanks!


----------



## tomm1079

With the Tivo ipad app coming out. I wonder if we will be able to check the traffic on the wifi network to see what commands are being sent to the tivo to get the information back? 

Is it possible that tivo is adding in hooks via IP to allow us to get this info (and just not telling us) where we might be able to figure it out by sniffing the network?

if so it would be nice to this little project.


----------



## orangeboy

Yep, I'd love to take advantage of anything "local" that I can!


----------



## orangeboy

I've made some code changes to make the data collected much more accurate. So now http://code.google.com/p/tivotodo/ has a new zip file! TiVoToDo.conf has changed a bit, too, to include which reports to write to file, and which reports to display. Also, Overlap Protection is now accounted for by use of the "clipping" keyword.

There's not a lot of change on the outside, but I am much more satisfied with the data collected. The ground work for conflict detection has been laid, and there has been progress in that area.

Many, many thanks go to innocentfreak for testing and uncovering bugs I didn't or couldn't encounter in my environment. :up:

If any problems are encountered, or any enhancements are thought of, please open a new issue here: http://code.google.com/p/tivotodo/issues/list


----------



## orangeboy

I added a couple of wiki pages to the project: http://code.google.com/p/tivotodo/w/list


----------



## innocentfreak

Just a suggestion but you may want to update the original op for this thread with a brief explanation and links to the wiki and program.


----------



## orangeboy

innocentfreak said:


> Just a suggestion but you may want to update the original op for this thread with a brief explanation and links to the wiki and program.


Done! :up:


----------



## orangeboy

I've got a New Year's date bug fix release at the Google project site. The download file is "TiVoToDo.v0r2m9.zip", built from revision 100. This release will fix a bug that skips all To Do List items dated on (or after) 1/1/2011.


----------



## bwall23

orangeboy said:


> I've got a New Year's date bug fix release at the Google project site. The download file is "TiVoToDo.v0r2m9.zip", built from revision 100. This release will fix a bug that skips all To Do List items dated on (or after) 1/1/2011.


I've been looking for an app like this. Saves a lot of time.

I really like where you're going as far as scheduling and conflict resolution. Wish the Tivo's did a better job of it.

Been doing my own screen scraping at tivo.com for TDL's on two TiVos, combining that with screen scraping from kmttg's NPL for both TiVos and integrating it with a listing of shows already transferred to PC. All in an effort to avoid dup recordings if they already exist on the PC or one of the TiVo's NPL or TDL.

Comment: The tivo.com TDL does not appear to be updating correctly. I login, view the TDL for one of my tivos, go to that tivo and remove a scheduled recording, force a tivo connection and the next day the scheduled recording still shows at tivo.com even though it's no longer on my tivos TDL.

Question/Request: How hard would it be to also grab and output the Episode Title and Description? (without this I cannot determine dups)

Suggestions: 

Output the four digit year in the CSV files (I see you have it internally)
Make the CSV files TAB (0x09) delimited since some EPTitles and Descriptions contain quotes and commas
Great work!


----------



## orangeboy

bwall23 said:


> ...Comment: The tivo.com TDL does not appear to be updating correctly. I login, view the TDL for one of my tivos, go to that tivo and remove a scheduled recording, force a tivo connection and the next day the scheduled recording still shows at tivo.com even though it's no longer on my tivos TDL.


It appears that tivo.com's TDL is updated by the VCM connections that happen. Those can't be (easily) forced, and seem to have a schedule of their own. I haven't tried it, but you may be able to initiate a VCM connection before the one scheduled by restarting the DVR, but that hardly seems convenient!



bwall23 said:


> Question/Request: How hard would it be to also grab and output the Episode Title and Description? (without this I cannot determine dups)


I'm using python's HTMLParser which is pretty flexible. It would be a matter of finding the correct location for those items in the page, and storing them. As it is now, I'm storing all the data in python List or Dictionary objects. I'm in the process of creating tables in a database to store the information. I'm thinking it will be easier to maintain (deleting rows of data that are older the "now", a time object that reflects when the program is run), and it should be easier to create/customize reports.



bwall23 said:


> Suggestions:
> 
> Output the four digit year in the CSV files (I see you have it internally)


Yeah, 4 digit year should be possible.



bwall23 said:


> Make the CSV files TAB (0x09) delimited since some EPTitles and Descriptions contain quotes and commas
> Great work!


I'm using the built-in "csv" python module, so I'd have to look into making tab delimited files. However, embedded quotes and commas should already be accounted for by the module, with using single or double quotes when needed. I'd like to get away from csv files and console text as the main output, and present the information on the TiVos themselves, in an HME app. With an HME app, I'd like to eventually have "conflicted" Season Passes on one DVR moved to another DVR. The python app would do the rescheduling based on TiVo remote selections. That's WAY down the road though.


----------



## bwall23

orangeboy said:


> It appears that tivo.com's TDL is updated by the VCM connections that happen. Those can't be (easily) forced, and seem to have a schedule of their own. I haven't tried it, but you may be able to initiate a VCM connection before the one scheduled by restarting the DVR, but that hardly seems convenient!


You're correct  it's not covenient at all.



orangeboy said:


> I'm using python's HTMLParser which is pretty flexible. It would be a matter of finding the correct location for those items in the page, and storing them. As it is now, I'm storing all the data in python List or Dictionary objects. I'm in the process of creating tables in a database to store the information. I'm thinking it will be easier to maintain (deleting rows of data that are older the "now", a time object that reflects when the program is run), and it should be easier to create/customize reports.


I look at the source for the page (TDL at tivo.com) and think, wouldn't it be nice if we had local access to our own TiVo's on our own LAN, instead of having to go through the Mother Ship each time. For now, I'll deal with the screen scraping of each showing at tivo.com as I can get all the detail I need (albeit, in a contorted, frustrating, multi-step process sort of way).



orangeboy said:


> Yeah, 4 digit year should be possible.


That's a good thing. When you open any of the csv's in Excel, another spreadsheet or database app, you'll have control of the data and can sort to your hearts content.



orangeboy said:


> I'm using the built-in "csv" python module, so I'd have to look into making tab delimited files. However, embedded quotes and commas should already be accounted for by the module, with using single or double quotes when needed. I'd like to get away from csv files and console text as the main output, and present the information on the TiVos themselves, in an HME app. With an HME app, I'd like to eventually have "conflicted" Season Passes on one DVR moved to another DVR. The python app would do the rescheduling based on TiVo remote selections. That's WAY down the road though.


In my years of experience, commas and double quotes wreak havoc with csv files. HEX & Programmers Editors have no problem with them, but just try to open or import them into something like Excel. TAB delimited files are also universal and bypass those limitations.

Thanks for taking suggestions on your app. I see where you're going with it and agree there's a need until TiVo develops a Multi-TiVo cooperative scheduler (and I'm holding my breath too, er, blue ;-)


----------



## Davemen

Has anyone done this in .NET yet?

I'm trying but having minimal success. Anyone converted this python code to C# or VB.NET yet?


----------



## moyekj

Davemen said:


> Has anyone done this in .NET yet?
> 
> I'm trying but having minimal success. Anyone converted this python code to C# or VB.NET yet?


 Why would one want to. Python is a lot more portable to platforms besides Windows and the eventual goal is for this to be an HME application so those other languages won't work.


----------



## Davemen

I'm just looking for a little help converting the code. Not looking to debate whether that's a good thing or a bad thing. 

Can anyone help?

Thanks!
-Dave


----------



## innocentfreak

Hey I was wondering if there might be a way to implement it so if TTD fails at grabbing something that it would retry. 

I ran TTD today and when it tried to grab a couple shows it failed to open the page. I didn't know if there was a way for it to try it again then or even at the end.


----------



## notaclone

All this, and no one figured out how to delete a recording via a network connection? BUMMED. I'll take any hack, no matter how complex or convoluted! Otherwise I'm trapped!


----------



## innocentfreak

notaclone said:


> All this, and no one figured out how to delete a recording via a network connection? BUMMED. I'll take any hack, no matter how complex or convoluted! Otherwise I'm trapped!


If you have a Premiere try KMTTG. They recently figured out how to delete shows among other things.


----------



## tomm1079

Any chance you might toss in support for the 4 tuners to the different things you generate?


I know you stopped working on it..but would be nice...


----------



## tomm1079

Also i have been getting this error for the last week or so. I think it is erroring out when recreating the cache. I get this on multiple PC's so its not my freshly rebuilt WHS

Traceback (most recent call last):
File "C:\Users\Tom\Desktop\TiVoToDo\TiVoToDo.py", line 101, in <module>
t.read_cache()
File "C:\Users\Tom\Desktop\TiVoToDo\tools.py", line 348, in read_cache
c.shows = pickle.load(cache)
File "C:\Python27\lib\pickle.py", line 1378, in load
return Unpickler(file).load()
File "C:\Python27\lib\pickle.py", line 858, in load
dispatch[key](self)
File "C:\Python27\lib\pickle.py", line 880, in load_eof
raise EOFError
EOFError

Any ideas


----------



## tomm1079

Not sure why i was getting errors before. I went to run it again tonight and everything is cleared up. Guess now i am just hoping for 4 tuners support. 

Is orangeboy still around? I have not seen him in a while.


----------

