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

pyTivo - Transcoding server

Discussion in 'TiVo Home Media Features & TiVoToGo' started by armooo, Nov 25, 2006.

  1. Nov 14, 2007 #941 of 5682
    designbot

    designbot Internet Cliché

    77
    0
    Mar 29, 2002
    Atlanta, GA
    OK,
    Code:
    python pyTivo.py
    didn't work, but
    Code:
    python /Applications/pyTivo/pyTivo.py
    did. I'm getting this message:
    Code:
    Traceback (most recent call last):
      File "/Applications/pyTivo/pyTivo.py", line 9, in ?
        port = config.get('Server', 'Port')
      File "/sw/lib/python2.4/ConfigParser.py", line 511, in get
        raise NoSectionError(section)
    ConfigParser.NoSectionError: No section: 'Server'
    
     
  2. Nov 14, 2007 #942 of 5682
    PaulS

    PaulS Member

    674
    1
    Sep 16, 2002
    Southern NH
    The configuration parsing module couldn't locate the "server" section of your conrfiguration file, or the pytivo.conf file itself.
     
  3. Nov 14, 2007 #943 of 5682
    designbot

    designbot Internet Cliché

    77
    0
    Mar 29, 2002
    Atlanta, GA
    OK, for some reason, pyTivo.conf was named pyTivo.conf.dist when I installed it. I renamed it to pyTivo.conf, and it seems to be working!

    Thanks!
     
  4. Nov 14, 2007 #944 of 5682
    designbot

    designbot Internet Cliché

    77
    0
    Mar 29, 2002
    Atlanta, GA
    I'm sure this is a clueless newbie question, but...

    When I quit the Terminal, it also quits python, which quits pyTivo. How do I keep pyTivo running without leaving a terminal window open all the time? Bonus points for starting it up automatically at login, and for being able to check if it's running.
     
  5. Nov 14, 2007 #945 of 5682
    reneg

    reneg Member

    699
    0
    Jun 19, 2002
    Taking advantage of the lifetime transfer offer, I now have two THDs and two series 2s in the household. I wanted a feature added to PyTivo that restricted which folders can be seen by multiple Tivos. I've never used Python before (and it probably shows to those that have), but this old dog managed to code something that works in my 4 Tivo household. All my Tivos are running at least 9.1x or higher. Thought I'd share my changes with the rest of the community.

    Filtering Folders
    Recognize a new descriptor in the pytivo.conf file called 'folders' in the [_tivo_*] sections. 'folders' is a comma separated list of the shares that are available on a particular Tivo. Invalid shares are ignored. If 'folders is not defined, then all shares defined in the pytivo.conf file are available. Example below.

    Partial pytivo.conf file
    Code:
    [_tivo_2400000DEADBEEF]
    folders= Vids1,Vids2,Vids4
    
    [_tivo_652000000C0FFEE]
    # Test for white space between shares
    folders= Vids1, Vids2 , Vids3
    
    [_tivo_24000000000BABE]
    folders= Vids1
    
    [_tivo_65200000BADCAFE]
    # Test for invalid share
    folders= Vids5
    
    [Vids1]
    type=video
    path=e:\vids
    
    [Vids2]
    type=video
    path=e:\vids2
    
    [Vids3]
    type=video
    path=e:\vids3
    
    [Vids4]
    type=video
    path=e:\vids4
    
    Source changes modified two files
    Changed Config.py:
    Code:
    <! def getShares():
     !> def getShares(tsn=None):
     !>     if not tsn:
     !>         return filter( lambda x: not(x.startswith('_tivo_') or x == 'Server'), config.sections())
     !> 
     !>     if config.has_section('_tivo_' + tsn):
     !>         if config.has_option('_tivo_' + tsn, 'folders'):
     !> 	    # clean up leading and trailing spaces & make sure ref is valid
     !> 	    tsnfolders = []
     !> 	    for x in config.get('_tivo_' + tsn, 'folders').split(','):
     !> 		y = x.lstrip().rstrip()
     !> 		if config.has_section(y):
     !> 		    tsnfolders += [y]
     !> 	    if tsnfolders:
     !> 	        return tsnfolders
            return filter( lambda x: not(x.startswith('_tivo_') or x == 'Server'), config.sections())
    
    Changed httpserver.py in 3 places:
    1) Added a couple of extra imports
    Code:
     
     !> from Config import config
     !> import Config
    
    2) Fixed a spelling error
    Code:
    <!                 self.RootContiner()
     !>                 self.RootContainer()
    
    3) Modified the code that returns the list of folders back to the Tivo
    Code:
    <!     def RootContiner(self):
     !>     def RootContainer(self):
     !> 	tsn = self.headers.getheader('TiVo_TCD_ID', '')
     !> 	tsnfolders = Config.getShares(tsn)
     !> 	tsncontainers = {}
     !> 	for section in tsnfolders:
     !> 	    settings = {}
     !> 	    settings.update(config.items(section))
     !> 	    tsncontainers.update({section : settings})
        	t = Template(file=os.path.join(SCRIPTDIR, 'templates', 'root_container.tmpl'))
     <!          t.containers = self.server.containers
     !> 	t.containers = tsncontainers
    
     
  6. Nov 14, 2007 #946 of 5682
    PaulS

    PaulS Member

    674
    1
    Sep 16, 2002
    Southern NH
    Put it in the background :

    Code:
    python /Applications/pyTivo/pyTivo.py &
    Yes, the ampersand is important.

    To see if it's currently running from a terminal window :

    Code:
    ps auwx | grep python
     
  7. Nov 14, 2007 #947 of 5682
    PaulS

    PaulS Member

    674
    1
    Sep 16, 2002
    Southern NH

    Nice! A couple of small points/quibbles.

    IMHO, it might be a little more coherent if you renamed your new "folders" config parameter to "shares". This will avoid someone trying to see/hide actual folders (once they're finally working with 9.x, natch), rather than the shares themselves.

    As an aside, how can we submit proper changes to the project ? The only interface I see are to submit a ticket and armooo integrates them when/if he sees fit (kinda slow response time), or we all maintain local copies and try to keep track of the changes manually (pain in the ass). Any other options ?
     
  8. Nov 14, 2007 #948 of 5682
    reneg

    reneg Member

    699
    0
    Jun 19, 2002
    'Folders' or 'Shares', it doesn't matter to me what they are called.

    I had no idea how to submit changes. Will be happy to submit a ticket or whatever the process is, but was hoping someone might try it out on their boxes to see how broken this code might be. I had to use a different string to get the tivo serial number (tsn) than is in video.py file. Not sure why that is but haven't really looked much at the video.py file.
     
  9. Nov 14, 2007 #949 of 5682
    designbot

    designbot Internet Cliché

    77
    0
    Mar 29, 2002
    Atlanta, GA
    Thank you! :)
     
  10. Nov 14, 2007 #950 of 5682
    fred22

    fred22 New Member

    41
    0
    Nov 11, 2007
    Well, I have edited, re-edited, UNinstalled pyTivo, used and not used the configuration program.

    In the NowPlaying I only see "folders" that contain videos or folders containing videos. I see THREE (3) items:

    My Tivos
    My Movies
    L Drive

    I do not see my mp3 associated folders/locations.

    Here is my conf file:

    [DEFAULT]
    path = <Pick A Path>
    type = video

    [Music]
    type = music
    path = C:/My Music

    [Space]
    type = music
    path = G:/ZVM Music

    [Server]
    ffmpeg = C:\Program Files\pyTivo\plugins\video\ffmpeg_mp2.exe
    guid = {6FE5C138-138F-4C01-ADC8-50137ECCBB4E}
    port = 9032
    width = 544

    [MyTivo]
    path = L:/MyTivoRecordings

    [Mp3's]
    type = music
    path = G:/MP3

    [MyMovies]
    type = video
    path = L:\Movies\Divx

    [L drive]
    type = video
    path = L:\Movies\Divx

    ...........................................

    (oh, WinXP SP2). Newest 9.2axxxxxx on the Tivo. Latest TivoDesktop. Galleon is installed. Tivo S3.

    I have successfully transferred videos from computer to tivo.

    I cannot seem to find the music.

    Maybe I will settle for the MOVIES and just stop trying (although I do get great exercise running up (computer room) and down (tivo/tv) the stairs).
     
  11. Nov 14, 2007 #951 of 5682
    PaulS

    PaulS Member

    674
    1
    Sep 16, 2002
    Southern NH
    I'd try running pyTivo again, with debug on, to try to get some more definitive answers.

    Here are a couple of guesses as to what's going on.

    First, I'm not sure you can define shares before the [server] parameter. I believe they need to be in the proper order to be parsed correctly. So, I'd try moving the [Music] and [Space] shares down towards the bottom of your config file and try again.

    Secondly, I'd try removing that apostrophe (') character from your [Mp3's] share name. It may be tripping up the config parser.
     
  12. Nov 14, 2007 #952 of 5682
    fred22

    fred22 New Member

    41
    0
    Nov 11, 2007
    PaulS and others:

    my MISTAKE (and now I can chuckle)

    I was looking for the results in the WRONG PLACE. I just went to see what was what with Galleon in Photos, music and more (or whatever that list is called) and there were all of my EXPERIMENTS.

    I had expected the mp3 lists to show up in NOW PLAYING but that is only for videos.

    Jefferson Airplane's White Rabbit is now playing and is a good theme for the magic pills involved/needed in this setup stuff.

    pyTivo does not care about apostrophe characters (actually, that was the example the programmer provided) nor does it care whether you use slashes or backslashes in the path statements.

    So my Embryonic Journey (more Jefferson Airplane appropriately enough) is now launched.

    Thanks for allowing me to experiment on your time.
     
  13. Nov 15, 2007 #953 of 5682
    Sicklybutsexy

    Sicklybutsexy New Member

    179
    0
    May 5, 2007
    This may have been addressed and I can't find it...But is there a fix to the playing 16:9 videos... Also is there a way to play the 16:9 videos on a 4:3 tv? thanks.
     
  14. Nov 15, 2007 #954 of 5682
    mitch2k2

    mitch2k2 New Member

    110
    0
    Aug 2, 2006
    If I'm not mistaken, pytivo does this automatically. Does here, in any case. Unless I'm misunderstanding your question.
     
  15. Nov 15, 2007 #955 of 5682
    Sicklybutsexy

    Sicklybutsexy New Member

    179
    0
    May 5, 2007
    It won't transcode 16:9 files to a 4:3 tv. not at least on my tivo.
     
  16. Nov 16, 2007 #956 of 5682
    fred22

    fred22 New Member

    41
    0
    Nov 11, 2007
    Query:

    If I recall correctly, the instructions suggest (require?) that Tivo Server but turned OFF??

    What is the server doing or why is that required?

    Thanks.
     
  17. Nov 16, 2007 #957 of 5682
    Sicklybutsexy

    Sicklybutsexy New Member

    179
    0
    May 5, 2007
    Ok, pytivo 208 is out. I'm unsure of the differences with this new one. I do know that I've tried the 16:9 videos and they still don't work. Can someone walk me through getting PyTivo to play these 16:9 aspect ratios on my TV.

    Thanks to everyone for all the hardwork, especially "the creator"
     
  18. Nov 16, 2007 #958 of 5682
    Iluvatar

    Iluvatar New Member

    377
    0
    Jul 22, 2006
    There is definitely something wrong with your setup. Displaying 16x9 content on a 4:3 screen is something that has worked properly since pyTivo was introduced. I would start with deleting your pyTivo folder and redownloading the latest version (v.201 seems to be super stable though), taking care to properly resetup your configuration file.

    What issues are you seeing with your videos? I have a 27" 4:3 screen that pyTivo has worked properly for since I started using it over a year ago.

    Care needs to be taken if files are downloaded off of this topic that users have posted just in case you have, simply because their setup may differ from what works for your setup.
     
  19. Nov 16, 2007 #959 of 5682
    Sicklybutsexy

    Sicklybutsexy New Member

    179
    0
    May 5, 2007
    I was doing well too. I had no problem downloading 16:9 content. I hadn't messed with my config file in a couple of months. It seems an update that I just received a few days ago (I think) has not allowed me to play 16:9 videos on my 4:3 tv. Can you post your config. I'm running 201 and have been. Right now I started using videora again :( for that ability.
     
  20. Nov 16, 2007 #960 of 5682
    Sicklybutsexy

    Sicklybutsexy New Member

    179
    0
    May 5, 2007


    What happens is that a black screen is shown with audio only, no picture
     

Share This Page