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. Jan 27, 2013 #81 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Attached is a new version that attaches the current directory path to the front of tivodecode in the popen() call. It also prints out the command that is being called which might help debug the problem. Make sure tivodecode is in the same folder as Tivo Proxy Server before running. If you get an error then please post the output so I can see the command that is being called.

    This version also adds a HTML webpage that has links and descriptions for the videos. I have VLC as my default player and I can just click on the link and have the video play in the web browser. To use just enter the following in to a web browser:
    Code:
    http://<Server_IP>:<Port>/html
    
     

    Attached Files:

  2. Jan 27, 2013 #82 of 133
    srauly

    srauly New Member

    95
    0
    Apr 26, 2000
    Simsbury,...
    Please post back if you get this working with Plex.
     
  3. Jan 28, 2013 #83 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    No apparent change I don't think...

    Code:
    Video URL:  http://192.168.2.10:80/download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPlaying&id=1338396
    
    192.168.2.16 - - [28/Jan/2013 15:04:37] "GET /download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPlaying&id=1338396 HTTP/1.1" 200 -
    
    Decoding video
    
    ['/Users/user/tivodecode', '-n', '-m', '***********', '--', '-']
    
    ----------------------------------------
    Exception happened during processing of request from ('192.168.2.16', 51563)
    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 6.py", line 229, 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
    ----------------------------------------
    
     
  4. Jan 28, 2013 #84 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    OK I might be onto something. I noticed in the output, this line is wrong:

    ['/Users/user/tivodecode', '-n', '-m', '***********', '--', '-']

    The correct path would be /Users/user/Desktop/tivodecode since I have my tivodecode folder on the desktop. So I changed this:

    Code:
                    cmd = [os.path.join(os.getcwd(), 'tivodecode'), '-n','-m', Tivo_MAK, '--', '-']
    
    to this:

    Code:
                    cmd = [os.path.join(os.getcwd(), 'Desktop/tivodecode/tivodecode'), '-n','-m', Tivo_MAK, '--', '-']
    
    and now I get this:

    Code:
    serving at port 10001
    /rss
    Sending RSS Feed
    
    192.168.2.16 - - [28/Jan/2013 15:59:28] "GET /rss HTTP/1.1" 200 -
    RSS Feed Sent
    
    /download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPlaying&id=1338396
    
    Video URL:  http://192.168.2.10:80/download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPlaying&id=1338396
    
    192.168.2.16 - - [28/Jan/2013 15:59:50] "GET /download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPlaying&id=1338396 HTTP/1.1" 200 -
    
    Decoding video
    
    ['/Users/user/Desktop/tivodecode/tivodecode', '-n', '-m', '***********', '--', '-']
    
    Launch of "tivodecode" failed: the PowerPC architecture is no longer supported.
    Disconnect
    
    Progress?
     
  5. Jan 28, 2013 #85 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Apparently on a mac the path is not being set to the program's path. You corrected the path and tivodecode must have been launched. What I don't know is if tivodecode or python is putting the "no longer supported" message. Can you try running tivodecode on a .tivo file from a command promp without my program? I want to see if tivodecode prints that message. If it does then you might need a different version that supports your OS.
     
  6. Jan 29, 2013 #86 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    Ooooh... I think we might be getting somewhere.

    I grabbed the copy of tivodecode that I actually use currently with kmttg, and got something new:

    Code:
    Encryption by QUALCOMM ;)
    
    Disconnect
    ----------------------------------------
    Exception happened during processing of request from ('192.168.2.16', 51787)
    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
    ----------------------------------------
    
    So, are we close to something perhaps?
     
  7. Jan 29, 2013 #87 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Vanclute, attached is an update that should fix the tivodecode path problem and hopefully fix the latest error you are getting.
     

    Attached Files:

  8. Jan 29, 2013 #88 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    sigh... afraid not:

    Code:
    /Users/user/Desktop/tivodecode/tivodecode
    
    Encryption by QUALCOMM ;)
    
    Disconnect
    ----------------------------------------
    Exception happened during processing of request from ('192.168.2.16', 50955)
    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
    ----------------------------------------
    
    Path is correct now but still no playback.
     
  9. Jan 29, 2013 #89 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    oops nevermind this... last post still accurate.
     
  10. Jan 29, 2013 #90 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Vanclute, remove the # character from these three lines of code at the bottom of the code then try running:

    Code:
    httpd.socket.setsockopt(socket.SOL_TCP, socket.TCP_KEEPIDLE, 1)
    httpd.socket.setsockopt(socket.SOL_TCP, socket.TCP_KEEPINTVL, 1)
    httpd.socket.setsockopt(socket.SOL_TCP, socket.TCP_KEEPCNT, 5)
    This code doesn't work on Windows but research shows it might work for mac and Linux.
     
  11. Jan 30, 2013 #91 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    Uncommenting those lines and running the script, I get:

    Code:
    Traceback (most recent call last):
      File "/Users/user/Desktop/tivodecode_MacOSX_intel/Tivo Proxy Server 7.py", line 326, in <module>
        httpd.socket.setsockopt(socket.SOL_TCP, socket.TCP_KEEPIDLE, 1)
    AttributeError: 'module' object has no attribute 'TCP_KEEPIDLE'
    logout
    
    [Process completed]
    
    
    Next ideas?
     
  12. Jan 30, 2013 #92 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Vanclute, delete those three lines, I guess they only work in Linux. I've seen reports of that "Broken pipe" error being caused by a firewall. Try turning off your firewall and testing the program. I'm starting to run out of ideas so hopefully it's your firewall.
     
  13. Jan 30, 2013 #93 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    sadly the firewall isn't running so... that's definitely not it.

    Will delete those lines (though they were commented out previously weren't they?) and see what happens...

    EDIT: No joy... broken pipe. Are there by chance any other Mac users who could take a stab at this so I can make sure it's not just me?
     
  14. Jan 30, 2013 #94 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Vanclute, try this version. In case tivodecode is taking it's time loading, I put a 5 second delay before sending any data to tivodecode. Also, maybe data is being transferred too fast so I reduced the number of bytes being read and written at one time.
     

    Attached Files:

  15. Jan 31, 2013 #95 of 133
    wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    I haven't looked at this in enough detail to know what the problem is, but I can guarantee you're barking up the wrong tree with those changes.
     
  16. Jan 31, 2013 #96 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    Alas wmcbrine appears to be correct, no change with the latest version.
     
  17. Feb 5, 2013 #97 of 133
    vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    So are we at a dead on with this on Mac? :( I was so hopeful...
     
  18. Feb 5, 2013 #98 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    I don't know how to correct your error. Someone with better knowledge of Python and Mac will need to help out.
     
  19. Feb 14, 2013 #99 of 133
    bradleys

    bradleys It'll be fine....

    3,687
    4
    Oct 31, 2007
    I finally figured out how to get VLC to read directly from the Proxy server...

    simply add the rss url as podcast under the playlist options. I do have javascript that can lookup poster art for the TV shows and movies - but not being familiar with python, it would take me quite a bit of effort to integrate it.

    [​IMG]

    But it was nice getting it to this point.
     

    Attached Files:

  20. vanclute

    vanclute Member

    157
    0
    Aug 3, 2003
    That's great... now if only the videos would play for me in the first place. :(
     

Share This Page