TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Main TiVo Forums > TiVo Home Media Features & TiVoToGo
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 09-17-2010, 07:01 PM   #1
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
TiVo ToDo list from website - success!

Quote:
Originally Posted by orangeboy View Post
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by orangeboy : 12-11-2010 at 08:09 AM. Reason: Add Google Code information
orangeboy is offline   Reply With Quote
Old 09-20-2010, 09:45 AM   #2
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-20-2010, 10:10 AM   #3
moyekj
Registered User
 
Join Date: Jan 2006
Location: Mission Viejo, CA
Posts: 8,879
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.
__________________
Roamio Pro (GigE)
Elite (MoCA)
Premiere (MoCA adapter)
Cox - Motorola CableCards & TAs
Slingbox 350 via TiVo Mini & TiVo Stream for remote viewing

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
moyekj is offline   Reply With Quote
Old 09-20-2010, 10:59 AM   #4
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by moyekj View Post
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!
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-20-2010, 11:03 AM   #5
gonzotek
tivo_xml developer
 
gonzotek's Avatar
 
Join Date: Sep 2004
Location: Outside Phildadelphia
Posts: 2,204
Quote:
Originally Posted by orangeboy View Post
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.
__________________
Follow @pytivo on Twitter for project updates and more!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
A Web app for Roku Remote Control
gonzotek is offline   Reply With Quote
Old 09-20-2010, 11:49 AM   #6
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by gonzotek View Post
I'm pretty sure the S2 tivos don't have support for the website NPL and ToDo lists.
Yep, confirmed:
Quote:
Online Now Playing and To Do Lists are not available for Series2 customers at this time.

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-20-2010, 09:30 PM   #7
tomm1079
Registered User
 
Join Date: May 2005
Posts: 566
wow very nice....putting this together with that advanced now playing list could give some good in via a web browser...
tomm1079 is offline   Reply With Quote
Old 09-22-2010, 10:00 AM   #8
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
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 "%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..."
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by orangeboy : 09-23-2010 at 06:44 PM.
orangeboy is offline   Reply With Quote
Old 09-25-2010, 01:53 PM   #9
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
A little better?

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 "%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>

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-25-2010, 10:31 PM   #10
tomm1079
Registered User
 
Join Date: May 2005
Posts: 566
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.
tomm1079 is offline   Reply With Quote
Old 09-26-2010, 05:44 AM   #11
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by tomm1079 View Post
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:
  1. 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.
  2. 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".

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 06:24 AM   #12
reneg
Registered User
 
Join Date: Jun 2002
Posts: 452
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')]

reneg is offline   Reply With Quote
Old 09-26-2010, 07:23 AM   #13
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by reneg View Post
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!

Quote:
Originally Posted by reneg View Post
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.

Quote:
Originally Posted by reneg View Post
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...

Quote:
Originally Posted by reneg View Post
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.

Quote:
Originally Posted by reneg View Post
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?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 07:58 AM   #14
txporter
One sec, almost done
 
Join Date: Sep 2006
Location: Austin, TX
Posts: 666
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.
__________________
Tivo Premiere 2TB WD20EARS (lifetime)
TivoHD 1TB WD10EACS + 1TB WD10EVCS Antec MX-1 (lifetime)
TivoHD 1TB WD10EACS (lifetime)
Series2 540 400GB Seagate DB35 (lifetime)
txporter is offline   Reply With Quote
Old 09-26-2010, 08:04 AM   #15
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by txporter View Post
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by orangeboy : 09-26-2010 at 08:23 AM.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 08:41 AM   #16
SeanC
ECT
 
SeanC's Avatar
 
Join Date: Dec 2003
Location: Someplace
Posts: 8,923
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?
SeanC is offline   Reply With Quote
Old 09-26-2010, 08:55 AM   #17
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by SeanC View Post
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 = your.email@your.email.provider

[password]
password = supersecretpassword
email is the email address used to login to tivo.com's website.
password is the password to the site.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by orangeboy : 09-26-2010 at 09:04 AM.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 09:08 AM   #18
SeanC
ECT
 
SeanC's Avatar
 
Join Date: Dec 2003
Location: Someplace
Posts: 8,923
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.
SeanC is offline   Reply With Quote
Old 09-26-2010, 09:17 AM   #19
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by SeanC View Post
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 09:24 AM   #20
SeanC
ECT
 
SeanC's Avatar
 
Join Date: Dec 2003
Location: Someplace
Posts: 8,923
Quote:
Originally Posted by orangeboy View Post
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.
SeanC is offline   Reply With Quote
Old 09-26-2010, 09:47 AM   #21
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by SeanC View Post
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 "%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...
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 09:55 AM   #22
SeanC
ECT
 
SeanC's Avatar
 
Join Date: Dec 2003
Location: Someplace
Posts: 8,923
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>

SeanC is offline   Reply With Quote
Old 09-26-2010, 10:10 AM   #23
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by SeanC View Post
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 10:19 AM   #24
SeanC
ECT
 
SeanC's Avatar
 
Join Date: Dec 2003
Location: Someplace
Posts: 8,923
Quote:
Originally Posted by orangeboy View Post
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.
SeanC is offline   Reply With Quote
Old 09-26-2010, 10:25 AM   #25
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by SeanC View Post
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!
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 10:29 AM   #26
SeanC
ECT
 
SeanC's Avatar
 
Join Date: Dec 2003
Location: Someplace
Posts: 8,923
PM sent.
SeanC is offline   Reply With Quote
Old 09-26-2010, 10:37 AM   #27
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by SeanC View Post
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 09-26-2010, 10:41 AM   #28
SeanC
ECT
 
SeanC's Avatar
 
Join Date: Dec 2003
Location: Someplace
Posts: 8,923
Bummah

Ah well, glad I could help out, I'll watch this thread for updates.
SeanC is offline   Reply With Quote
Old 09-26-2010, 10:52 AM   #29
tomm1079
Registered User
 
Join Date: May 2005
Posts: 566
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.
tomm1079 is offline   Reply With Quote
Old 09-26-2010, 11:03 AM   #30
moyekj
Registered User
 
Join Date: Jan 2006
Location: Mission Viejo, CA
Posts: 8,879
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).
__________________
Roamio Pro (GigE)
Elite (MoCA)
Premiere (MoCA adapter)
Cox - Motorola CableCards & TAs
Slingbox 350 via TiVo Mini & TiVo Stream for remote viewing

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
moyekj is offline   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVoŽ is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 04:38 PM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |