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

Tivo Proxy Server

Discussion in 'Developers Corner' started by Allanon, Jul 22, 2012.

  1. bradleys

    bradleys It'll be fine....

    3,687
    4
    Oct 31, 2007
    I am anxiously waiting for VLC for windows 8 to use this on the Surface Pro tablet - that I am chomping at the bit to buy.

    Sorry it doesn't work for you... It is still really unstable presented via the browser for me, but rock solid through VLC.
     
  2. Allanon

    Allanon Member

    581
    0
    Nov 2, 2005

    Attached Files:

  3. mulscully

    mulscully Member

    324
    0
    May 31, 2003
    Malvern, Pa
    here is the error I am getting now... Any help would be appreciated.. I am running Windows 7 and am running the version of the proxy server listed in post #103 above

    it does look like its starting to decode the video because the line right before the ---- it says

    Decoding video

    c:\Python27\tivodecode ( and I do have tivodecode in that directory, I copied the tivodecode dir from kmmttg into the Pyhton dir)

    [​IMG]
     
  4. Mar 1, 2013 #104 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Mulscully, I don't have Windows 7 or this problem so I was only able to look the error up on the internet and see how others fixed it. Some say just changing the directory to the path will solve the problem, so I added that code to this version. You might also try running as admin.
     

    Attached Files:

  5. Mar 1, 2013 #105 of 133
    mulscully

    mulscully Member

    324
    0
    May 31, 2003
    Malvern, Pa
    Thanks, I will give this a try sometime tonight or tomorrow and post the result....
     
  6. Mar 3, 2013 #106 of 133
    mulscully

    mulscully Member

    324
    0
    May 31, 2003
    Malvern, Pa
    Nah... still getting the same error... Believe its a win 7 issue....
     
  7. vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    I suspect you aren't really tracking the Mac issues since you aren't a Mac user, but I'm back to this error again. This is with the version you posted on 02.28.13:
    Code:
    /download/The%20Piano%20Guy.TiVo?Container=%2FNowPlaying&id=1339151
    
    Video URL:  http://192.168.2.10:80/download/The%20Piano%20Guy.TiVo?Container=%2FNowPlaying&id=1339151
    
    192.168.2.16 - - [10/Mar/2013 19:11:27] "GET /download/The%20Piano%20Guy.TiVo?Container=%2FNowPlaying&id=1339151 HTTP/1.1" 200 -
    
    Decoding video
    
    /Users/user/tivodecode
    
    ----------------------------------------
    Exception happened during processing of request from ('192.168.2.16', 57057)
    Traceback (most recent call last):
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 310, in process_request
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 639, in __init__
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 337, in handle
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 325, in handle_one_request
      File "/Users/user/Desktop/tivodecode/Tivo Proxy Server.py", line 231, in do_GET
        decode = subprocess.Popen(cmd,shell=False,bufsize=0,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
    OSError: [Errno 2] No such file or directory
    ----------------------------------------
    
     
  8. Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Vanclute, for some reason the last version didn't have the code that fixed your path problem. This version should work.
     

    Attached Files:

  9. vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    Unfortunately, no go here either.

    Code:
    Video URL:  http://192.168.2.10:80/download/The%20Piano%20Guy.TiVo?Container=%2FNowPlaying&id=1343114
    
    192.168.2.16 - - [28/Mar/2013 22:15:58] "GET /download/The%20Piano%20Guy.TiVo?Container=%2FNowPlaying&id=1343114 HTTP/1.1" 200 -
    
    Decoding video
    
    
    /Users/user/Desktop/tivodecode/tivodecode
    
    Encryption by QUALCOMM ;)
    
    Disconnect
    ----------------------------------------
    Exception happened during processing of request from ('192.168.2.16', 51043)
    Traceback (most recent call last):
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 310, in process_request
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 641, in __init__
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 694, in finish
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
    error: [Errno 32] Broken pipe
    ----------------------------------------
    
     
  10. ligand

    ligand New Member

    9
    2
    Jun 20, 2010
    So I tried setting this up last night on my mac and got it to work. :) I used the latest script that was posted. Compiled TivoDecode and copied to the same directory as the python script. Started the python script using sudo. Using firefox, I was able to retrieve the RSS feed and then I copied the link to VLC and to my pleasant surprise it worked! :) Great Job!
     
  11. berkinet

    berkinet New Member

    34
    0
    Dec 20, 2013
    Thanks to @allanon for the hard work on this, and to @ligand for the key hint on MacOS.

    I found the sudo was not necessary. Also, the problem with tivodecode is caused by the path. Following the previous tip of entering the url into VLC as a podcast, I am able to see the program list and view the video in VLC.

    On the other hand, if I quit viewing a video the proxy server does not gracefully trap the errors. For example, I get:
    Code:
    Disconnect
    ----------------------------------------
    Exception happened during processing of request from ('127.0.0.1', 52581)
    Traceback (most recent call last):
      File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/SocketServer.py", line 222, in handle_request
        self.process_request(request, client_address)
      File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/SocketServer.py", line 241, in process_request
        self.finish_request(request, client_address)
      File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/SocketServer.py", line 254, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/SocketServer.py", line 522, in __init__
        self.handle()
      File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/BaseHTTPServer.py", line 316, in handle
        self.handle_one_request()
      File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
        method()
      File "Tivo_Proxy_server.py", line 268, in do_GET
        decode.terminate()
    AttributeError: 'Popen' object has no attribute 'terminate'
    
    I'll take a look at this and see if I can figure out why Popen is unhappy.
     
  12. berkinet

    berkinet New Member

    34
    0
    Dec 20, 2013
    I resolved the (non) issue with AttributeError: 'Popen' object has no attribute 'terminate'. Seems my installation was incorrectly referencing the Python 2.5 framework.

    However, of greater interest, I resolved the errors thrown when a stream display is interrupted. I sub-classed SocketServer to add error handling. I added the class mySocketServer and changed the https setup server to reference it. Here is the changed part of the code:
    Code:
    class mySocketServer(SocketServer.TCPServer):
      def handle_error(self, _, client_address):
        """Handle exceptions; overrides SocketServer.handle_error.
        """
        print "Stream display unexpectedly interrupted"
    
    # Start Proxy Server
    httpd = mySocketServer(("", Port), Handler)
    print "serving at port", Port
    httpd.serve_forever()
     
  13. Mar 8, 2014 #113 of 133
    cyberweasel

    cyberweasel New Member

    6
    0
    Apr 4, 2007
    Is it possible to make this work with Plex? That would be awesome. I have Plex setup and the Tivo Proxy running and working. I would love to have them work together :D
     
  14. Mar 9, 2014 #114 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    I looked in to doing this and found that Plex needs a URL service to read a RSS feed. It doesn't recognize Tive Proxy Server as a URL service so it won't read the RSS feed. I was able to save the RSS feed from Tivo Proxy Server to a file and get it to display in Plex using the RSS Feed plugin. But when selecting a video to be played it didn't play. Tivo Proxy Server seemed to be streaming the video to Plex but the loading icon remained displayed on the Plex video player. I don't know how to solve this problem.
     
  15. ppeewang

    ppeewang New Member

    16
    0
    Aug 27, 2012
    I got the rss feed to work once, but now it seems like it is stuck, I will report back "Working......." in the log screen and I never get any thing returned to my browser. any ideas ?
     
  16. Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    The "Working...." text is the program downloading and parsing the RSS feed from the Tivo. If you have a lot of videos on the Tivo it can take a long time. Also if it doesn't find the Tivo or can't download the Tivo XML file then the program may just keep printing dots. Make sure the Tivo's URL and MAK are correct.
     
  17. ppeewang

    ppeewang New Member

    16
    0
    Aug 27, 2012

    MAK and Url were correct. For whatever reason, my Tivo's httpd must have died and I ended up having to re-start the Tivo to get it working again. After I got it back up it worked for a bit, but as I started watching a show it ended up flaking out on the stream. It would stop playing and repeat a few seconds of the show I was watching. Any useful tweaks or suggestions ? I really love this program!
     
  18. Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    I know Series 3 Tivos can't stream HD fast enough to watch in real time, SD works fine. You will need to pause the stream and let it buffer before watching an HD video. Also your computer speed might be a factor because it is decoding the Tivo video in real time and if you have a slow computer then it might have problems. I was using a Pentium 4 CPU without problems but anything slower might not work.
     
  19. ppeewang

    ppeewang New Member

    16
    0
    Aug 27, 2012
    Thanks, I'll run this hard wired on a better system and see what happens. Was using a laptop wirelessly initially.
     
  20. tlc

    tlc Member

    710
    0
    May 29, 2002
    I'm seeing "Broken pipe" as well.
    Print statement debugging puts it in the self.wfile.write(chunk) call.
     

Share This Page