1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

List series ID's

Discussion in 'TiVo Home Media Features & TiVoToGo' started by wmcbrine, Nov 25, 2007.

  1. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    In case anyone's interested, here's a little Python program I wrote to dump the list of series ID's currently in your Now Playing list. More of a programming exercise for myself, but anyway...

    Code:
    #!/usr/bin/env python
    
    ''' 
    Grabs the Series IDs of current recordings from your TiVo and lists 
    them, together with the titles of the series. You need your Media Access 
    Key and the IP address of your TiVo.
    '''
    
    def open_tivo(address, mak):
        "Open the Now Playing page at 'address', with Media Access Key 'mak'"
        import urllib2
        url = 'https://%s/TiVoConnect?Command=QueryContainer&Container=/NowPlaying&Recurse=Yes'
        pm = urllib2.HTTPPasswordMgrWithDefaultRealm()
        pm.add_password(None, address, 'tivo', mak)
        opener = urllib2.build_opener(urllib2.HTTPDigestAuthHandler(pm))
        return opener.open(url % address)
    
    def get_mak():
        "Return tivodecode's record of the MAK, if available; otherwise prompt"
        import os.path
        makfile = os.path.join(os.path.expanduser('~'), '.tivodecode_mak')
        if os.path.isfile(makfile):
            try:
                return open(makfile).read().strip()
            except:
                pass
        return raw_input('Media Access Key? ')
    
    def get_id_list(source):
        "XML -> dict of titles and series ID's"
        from xml.dom import minidom
        xmldoc = minidom.parse(source)
        items = xmldoc.childNodes[0].getElementsByTagName('Item')
    
        # Build a dictionary of the titles and series ID's for every item
        # that has a series ID.
    
        return dict([
               (i.getElementsByTagName('Title')[0].childNodes[0].data,
                i.getElementsByTagName('SeriesId')[0].childNodes[0].data)
                for i in items if i.getElementsByTagName('SeriesId')
            ])
    
    def report(ids):
        "Print a title-sorted list from a dict of titles and series ID's"
        titles = ids.keys()
        titles.sort()
    
        for i in titles:
            print ids[i].ljust(9), i
    
    if __name__ == '__main__':
        print __doc__
    
        tivoaddress = raw_input('TiVo address? ')
        tivomak = get_mak()
    
        print '\nOpening...'
    
        source = open_tivo(tivoaddress, tivomak)
    
        print 'Parsing...\n'
    
        series_ids = get_id_list(source)
        source.close()
    
        report(series_ids)
    
    If you like, post your lists in this thread. I'm a little curious if the IDs are the same for all boxes or not...
     

    Attached Files:

  2. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    Example of using this as a module -- merged list from two Tivos:

    Code:
    import seriesids
    
    mak = seriesids.get_mak()
    s1 = seriesids.open_tivo('dhcp2', mak)
    list1 = seriesids.get_id_list(s1)
    s1.close()
    s2 = seriesids.open_tivo('dhcp4', mak)
    list2 = seriesids.get_id_list(s2)
    s2.close()
    
    seriesids.report(dict(list1.items() + list2.items()))
    
     
  3. Enrique

    Enrique Active Member

    5,066
    4
    May 15, 2006
    I am not 100% how to do this, but I did put in my Tivo IP then Tivo mak then it show this:

    SH963097 A Shot at Love With Tila Tequila
    SH753786 Ghost Whisperer
    SH797834 Is It Real?
    SH931008 K-Ville
    SH931177 Moonlight
    SH930981 Pushing Daisies
    SH696201 The Biggest Loser
    SH951139 The Steve Wilkos Show
    SH767257 The Tyra Banks Show

    I am only missing one show off of that list.
     
  4. dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Works as advertised, thanks! I just hard-coded in my IP and MAK in the main function.

    Here's my list:

    SH818666 10 Days That Unexpectedly Changed America
    SH524061 CSI: Miami
    SH079723 Civil War Journal
    TS1318011 Cranky Geeks
    SH017479 Great Performances
    SH726133 The Office

    Note the Cranky Geeks ID is one char longer than the others. This is a TiVo Cast program which is protected.

    And thanks for the great example for learning http access via Python.
     
  5. armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    SH457051 Access Granted
    SH575702 America's Next Top Model
    SH550252 America's Test Kitchen From Cook's Illustrated
    SH593047 Animal Cops Houston
    SH710749 Battlestar Galactica
    SH910397 Blood Plus
    SH237920 Champions of the Wild
    SH597231 Clean Sweep
    TS1318011 Cranky Geeks
    SH929309 Critical Situation
    SH959565 Death Note
    SH753529 Decoding the Past
    SH625603 Designed to Sell
    SH611442 Dirty Jobs
    SH927779 Ergo Proxy
    SH867320 Everest: Beyond the Limit
    SH679852 Exploraciones
    SH667618 Find & Design
    SH303483 Futurama
    SH838748 Gokusen
    SH273928 Good Eats
    SH137975 H.G. Wells' Invisible Man
    SH848361 Heroes
    SH625051 How Do I Look?
    SH277665 If Walls Could Talk
    SH647153 Iron Chef America
    SH017617 Law & Order
    SH726130 Law & Order: Trial by Jury
    SH337496 Lexx
    SH400025 MTV Cribs
    SH552974 Made
    SH769884 Mirage of Blaze
    SH103115 Modern Marvels
    SH960782 Moonphase
    SH557678 MythBusters
    SH683074 Naked Science
    SH003138 Nightline
    SH925647 Noein
    SH807675 Parental Control
    SH899881 Planet Earth
    SH593272 Profiles of Nature
    SH705529 Project Runway
    SH767508 Rezoned
    SH864685 Saiyuki Reload
    SH814966 Samurai 7
    SH760882 Small Space, Big Style
    SH003985 Star Trek
    SH446583 Star Trek: Enterprise
    SH685627 Survivorman
    SH598805 Tactical to Practical
    SH927781 Tenjho Tenge
    SH508952 The Dead Zone
    SH380343 The District
    SH211446 The Practice
    SH052522 The Real World
    SH290992 The Sopranos
    SH711080 The Ultimate Fighter
    SH919501 The Universe
    SH080955 The X-Files
    SH393384 Trading Spaces
    SH231685 Trauma: Life in the ER
    SH848057 Trinity Blood
    SH645952 Untold Stories of the E.R.
    SH446477 Unwrapped
    SH962738 Virus Buster Serge
    SH476707 What Not to Wear
     
  6. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    Yeah, the regular series ID's are "SH" followed by six digits, and the TivoCasts are "TS" followed by seven digits. I was surprised that they seem to have reserved ten times as much space for TivoCast ID's.

    Anyway, here are mine:

    SH848357 30 Rock
    SH445113 Alias
    SH466293 Aqua Teen Hungerforce
    SH393237 At the Movies With Ebert & Roeper
    SH062528 Beavis and Butt-head
    SH506521 Blue Gender
    TS1000631 CNET
    SH380341 CSI: Crime Scene Investigation
    SH524061 CSI: Miami
    SH679714 CSI: NY
    SH658623 Case Closed
    TS2060461 Channel Frederator
    SH019177 Charlie Rose
    TS1002251 Circuits
    TS1317131 DL.TV
    SH649011 Danny Phantom
    SH672318 Desperate Housewives
    SH686098 Drawn Together
    TS1014971 El Callejon de los Milagros
    SH665420 Entourage
    SH840179 Eureka
    SH296001 Family Guy
    SH945608 Flash Gordon
    SH018042 Frank TV
    SH303483 Futurama
    SH842020 Galaxy Railways
    SH732283 Grey's Anatomy
    SH860665 Hidden Potential
    SH415402 How It's Made
    TS1014971 Inspiracion
    SH926063 Live From Abbey Road
    SH154796 MAD TV
    SH962243 Mars Rising
    SH657011 Mike and Mike in the Morning
    SH669838 NFL Total Access
    SH585876 Reno 911!
    SH899947 Robin Hood
    SH003732 Scientific American Frontiers
    SH446160 Scrubs
    SH016916 Seinfeld
    SH586790 Sell This House!
    SH229827 South Park
    SH432225 Special Unit 2
    SH578678 Sports Reporters
    SH003985 Star Trek
    SH666541 Stargate Atlantis
    SH579364 Subterranean
    SH846730 Tenchi Muyo! GXP
    SH277598 That '70s Show
    SH684279 The Batman
    SH508952 The Dead Zone
    SH424998 The Fairly OddParents
    SH155564 The NewsHour With Jim Lehrer
    SH726133 The Office
    SH018693 The Simpsons
    SH451469 The Suze Orman Show
    SH019110 The Twilight Zone
    SH476707 What Not to Wear
    SH004762 Wheel of Fortune
    SH827464 Wild Things
    SH882710 Wired Science
    SH524080 Without a Trace
    SH854373 Yin Yang Yo!
    TS1007411 wmcbrine's TiVo Channel

    ...and I see that "Futurama", "Star Trek" and "What Not to Wear" match armoo's ID's, "The Office" matches dlfl's, and armoo and dlfl's "Cranky Geeks" match. So I guess we can safely say that they're universal.
     
  7. greg_burns

    greg_burns Now in HD

    6,384
    0
    May 21, 2004
    Slower...
    SH586260 48 Hours Mystery
    SH931010 Back to You
    SH930788 Bionic Woman
    TS1007641 Break.com
    SH861889 CBS Evening News With Katie Couric
    TS1000631 CNET
    SH380341 CSI: Crime Scene Investigation
    SH524061 CSI: Miami
    SH679714 CSI: NY
    SH592727 Cold Case
    SH508651 Cold Case Files
    SH753791 Criminal Minds
    TS1317131 DL.TV
    SH019155 Dateline NBC
    SH796119 Deal or No Deal
    SH517851 Dr. Phil
    SH848361 Heroes
    SH688359 House
    MV009888 House on Haunted Hill
    SH930774 Journeyman
    SH931618 Kid Nation
    SH932409 Kitchen Nightmares
    SH592616 Las Vegas
    SH076838 Late Show With David Letterman
    SH672362 Lost
    SH681911 NCIS
    SH536592 Paula's Home Cooking

    MV must be Amazon Unbox.

    Wondering why this skipped a lot of my shows?
     
  8. wgw

    wgw New Member

    217
    0
    May 16, 2007
    thanks for the utility. I manually built a series id list yesterday, but this is sooooo much easier.

    I have an MV as well but Broken Trail was recorded from AMC.

    SH930788 Bionic Woman
    SH672369 Boston Legal
    SH930987 Cavemen
    SH930779 Chuck
    SH672318 Desperate Housewives
    SH225826 Dharma & Greg
    SH848361 Heroes
    SH930774 Journeyman
    SH173109 Kindred: The Embraced
    SH484723 Last Call With Carson Daly
    SH080187 Late Night With Conan O'Brien
    SH076838 Late Show With David Letterman
    SH932208 Life Is Wild
    SH931177 Moonlight
    SH380827 Movies
    SH681911 NCIS
    SH712872 NUMB3RS
    SH963115 Pageant Place
    SH754199 Prison Break
    SH733773 Ready, Set, Change!
    SH932210 Reaper
    SH446160 Scrubs
    SH848759 Shark
    SH754231 Supernatural
    SH931182 The Big Bang Theory
    SH004397 The Tonight Show With Jay Leno
    SH753792 The Unit
    SH592733 Two and a Half Men
    SH931169 Viva Laughlin
    SH930986 Women's Murder Club
    SH790978 All Star Workouts
    SH898877 Blood Ties
    SH960717 Blue Planet
    SH480422 Blue Planet: Seas of Life
    MV178361 Broken Trail
    SH830603 Brotherhood
    TS1000631 CNET
    SH378317 Coupling
    TS1318011 Cranky Geeks
    SH391978 Curb Your Enthusiasm
    TS1317131 DL.TV
    SH388853 Dark Angel
    SH225330 Dead Man's Gun
    SH750178 Doctor Who
    SH960860 Five Days
    SH945608 Flash Gordon
    SH469459 Forecast Earth
    SH868991 It's All Geek to Me
    SH762956 It's Always Sunny in Philadelphia
    SH859980 Man vs. Wild
    SH511651 Monk
    SH380827 Movies
    SH002995 Murder, She Wrote
    SH712872 NUMB3RS
    SH683074 Naked Science
    SH003134 Night Court
    SH837834 Psych
    SH899947 Robin Hood
    TS1002401 Rocketboom
    SH432225 Special Unit 2
    SH446583 Star Trek: Enterprise
    SH666541 Stargate Atlantis
    SH685627 Survivorman
    SH665214 The 4400
    SH508952 The Dead Zone
    SH004279 The Gene Autry Show
    SH453168 The Office
    SH019110 The Twilight Zone
    SH947230 Torchwood
    SH679777 Vacation Home Search
    SH759395 Weeds
     
  9. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    I have a couple of Unbox entries in my list (free "purchases"), and they're both "TS1014971". I hadn't seen "MV" before. I'd guess that "MV" is for "Movie", "SH" for "Show", and "TS" maybe for "TivoCast Show"? But I have several movies in my Now Playing list, and they don't have any ID's.

    Hmm... I wonder if it could be that an "MV" entry will hang around as long as the movie is in the guide data, and then disappear?

    It only covers shows that are currently in the Now Playing list (not shows that you just have Season Passes for); some entries don't have Series ID's; and I've read that the "&Recurse=Yes" lookup will stop after 128 entries, which I didn't bother to work around. If it's not one of those reasons, I don't know.
     
  10. wgw

    wgw New Member

    217
    0
    May 16, 2007
    I did a Universal Swivel on Broken Trail and found that it is also available as an Unbox download. The relation to Unbox may be why the cable recording has the MV ID.
     
  11. greg_burns

    greg_burns Now in HD

    6,384
    0
    May 21, 2004
    Slower...
    Yeah, I thought about the 128 issue. But I have less than 100 in my NPL.

    Guess I should take a look a python. Is this an interpreted language (ie, not complied). How do you look at the source? Is PythonWin the editor? When I try to run that I get an error about MFC71.DLL not being found. Time to reinstall. :)

    :eek: don't go to python.com! :p

    http://www.python.org/
     
  12. CuriousMark

    CuriousMark Forum Denizen

    2,606
    0
    Jan 13, 2005
    SoCal
    Unlike languages that use beginning and ending delimiters for nesting and allow you to add indenting, python uses the indenting explicitly for nesting. This makes it cleaner and easier to read.

    It is interpreted, but does "compile" the raw code to tokens in a PYC file that it can run a bit faster. That feature can be turned off if desired.

    The source is the *.py file. You can edit it with any text editor. There are many that are python aware. I currently use Textpad, but PyWin and about a dozen others are good too. I personally prefer the active state version for installation on a PC since it includes PyWin and a couple of other additions that you will always end up getting on your own anyway. It also includes the complete Python docs in a nice windows help file.

    Since Python is fully interactive, you can simply start the interpreter and type python directly into and it will run, just like Basic did in my youth.
     
  13. greg_burns

    greg_burns Now in HD

    6,384
    0
    May 21, 2004
    Slower...
    Thanks Mark. Tried at first with Notepad and it didn't recognize the CR LF. Scared me, thought I was looking at a binary. :D
     
  14. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    Indeed, there are no CRLF sequences -- just LF's. That's because I typed it in nano, under Linux, where plain LF is the standard line ending. Sorry. :)

    I think most editors nowadays will recognize CRLF, LF, or even CR (old Mac standard) as line endings, but notepad is an annoying CRLF-only holdout, even as it's gained the ability to read UTF-8, UTF-16, and huge files.
     
  15. windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    Wow, pretty cool. I've got to jump back into the pyTiVo thread ... I've been watching (but not really reading) all the progress being made over there.

    Here's my list:

    SH847517 Ace of Cakes
    SH445113 Alias
    SH565783 American Chopper
    SH317395 Angel
    SH598470 Arrested Development
    SH710749 Battlestar Galactica
    SH876404 Challenge
    SH550283 Chappelle's Show
    SH446167 Crossing Jordan
    SH380341 CSI: Crime Scene Investigation
    SH679714 CSI: NY
    SH649011 Danny Phantom
    SH203444 Denise Austin's Daily Workout
    SH291777 Denise Austin's Fit & Lite
    SH225826 Dharma & Greg
    SH883566 Dinner: Impossible
    SH611442 Dirty Jobs
    SH115131 ER
    SH840179 Eureka
    SH190061 Everybody Loves Raymond
    SH633487 Extreme Makeover: Home Edition
    SH296001 Family Guy
    SH841570 Feasting on Asphalt
    SH524463 Firefly
    SH115127 Friends
    SH303483 Futurama
    SH720935 Go Baby
    SH273928 Good Eats
    SH963734 Gourmet Next Door
    SH732283 Grey's Anatomy
    SH835935 Guy's Big Bite
    SH848361 Heroes
    SH298935 Home Movies
    SH415402 How It's Made
    SH084554 How to Boil Water
    SH778976 I Love the '80s: 3D
    SH358427 Inhale
    SH647153 Iron Chef America
    SH762956 It's Always Sunny in Philadelphia
    SH002348 Jeopardy!
    SH508607 Kim Possible
    SH207002 King of the Hill
    SH080187 Late Night With Conan O'Brien
    SH017617 Law & Order
    SH446173 Law & Order: Criminal Intent
    SH316978 Law & Order: Special Victims Unit
    SH925303 Lil' Bush
    SH836453 Lou and Lou: Safety Patrol
    SH859980 Man vs. Wild
    SH713516 Medium
    SH851909 Metalocalypse
    SH511651 Monk
    SH557678 MythBusters
    SH173694 Nash Bridges
    SH338961 NewsChannel 8 Today
    SH003134 Night Court
    SH589658 Nip/Tuck
    SH899881 Planet Earth
    SH930971 Private Practice
    SH837834 Psych
    SH610633 Repo Men: Stealing for a Living
    SH725962 Robot Chicken
    SH003650 Rockford Files
    MV024517 Rosencrantz and Guildenstern Are Dead
    SH003710 Saturday Night Live
    SH446160 Scrubs
    SH462576 Sealab 2021
    SH265438 Sex and the City
    SH003837 Simon & Simon
    SH438626 Six Feet Under
    SH229827 South Park
    SH446583 Star Trek: Enterprise
    SH666541 Stargate Atlantis
    SH225421 Stargate SG-1
    SH661415 Stroker and Hoop
    SH753827 Surface
    SH685627 Survivorman
    SH775388 The Boondocks
    SH293053 The Daily Show With Jon Stewart
    SH453168 The Office
    SH492273 The Shield
    SH018693 The Simpsons
    SH681066 The Soup
    SH004397 The Tonight Show With Jay Leno
    SH560454 The Venture Brothers
    SH317016 Third Watch
    SH947230 Torchwood
    SH446477 Unwrapped
    SH273673 Whose Line Is It Anyway?

    There's the MV prefix for an Unbox movie again. Obviously a lot of those listed above are Suggestions ... I don't have that many SPs.
     
  16. PaulS

    PaulS Member

    674
    1
    Sep 16, 2002
    Southern NH
    Just thinking out loud here...

    Wouldn't you think that there would be a way to glean these values from TiVo's on-line scheduling web site ? It just makes too much sense to me.

    [edit]

    YES! Although not where I was expecting it to be. If you look up a show in zap2it.com (not tivo.com), you'll see the SeriesID embedded in the URL. Examples :


    SH830603 Brotherhood
    http://tvlistings.zap2it.com/tvlistings/ZCProgram.do?method=getDetail&pgmId=EP008306030022

    SH303483 Futurama
    http://tvlistings.zap2it.com/tvlistings/ZCProgram.do?method=getDetail&pgmId=EP003034830015

    SH611442 Dirty Jobs
    http://tvlistings.zap2it.com/tvlistings/ZCProgram.do?method=getDetail&pgmId=EP006114420016
     
  17. HDTiVo

    HDTiVo Not so Senior Member

    5,556
    0
    Nov 27, 2002
    What ID do you get if the recording is from a Wishlist? Say "Movies & Lassie" ...

    Wondering about WL grouping vs. Series grouping ...


    Also, I downloaded the file, but I don't have whatever it is that it runs in, python?
     
  18. PaulS

    PaulS Member

    674
    1
    Sep 16, 2002
    Southern NH
    That would be an interesting test to try out.

    You need to install python : DOWNLOAD PYTHON
     
  19. PaulS

    PaulS Member

    674
    1
    Sep 16, 2002
    Southern NH
    Here are the complete SeriesID lists, sorted by name and by ID. Enjoy!
     

    Attached Files:

  20. billb914

    billb914 New Member

    58
    0
    Jan 3, 2005
    I'm and old perl hack but know nothing of python. I think I did something wrong:

    Opening...
    Traceback (most recent call last):
    File "seriesids.py", line 60, in ?
    source = open_tivo(tivoaddress, tivomak)
    File "seriesids.py", line 16, in open_tivo
    return opener.open(url % address)
    File "c:\Python22\lib\urllib2.py", line 333, in open
    'unknown_open', req)
    File "c:\Python22\lib\urllib2.py", line 307, in _call_chain
    result = func(*args)
    File "c:\Python22\lib\urllib2.py", line 837, in unknown_open
    raise URLError('unknown url type: %s' % type)
    urllib2.URLError: <urlopen error unknown url type: https>
     

Share This Page