TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Underground Playground > Developers Corner
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 01-29-2013, 11:23 PM   #91
vanclute
Registered User
 
Join Date: Aug 2003
Posts: 137
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?
vanclute is offline   Reply With Quote
Old 01-30-2013, 01:32 AM   #92
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
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.
Allanon is offline   Reply With Quote
Old 01-30-2013, 11:07 AM   #93
vanclute
Registered User
 
Join Date: Aug 2003
Posts: 137
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?
vanclute is offline   Reply With Quote
Old 01-30-2013, 02:17 PM   #94
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
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
File Type: zip Tivo Proxy Server.zip (2.5 KB, 14 views)
Allanon is offline   Reply With Quote
Old 01-31-2013, 02:11 AM   #95
wmcbrine
Resistance Useless
 
wmcbrine's Avatar
 
Join Date: Aug 2003
Posts: 8,913
Quote:
Originally Posted by Allanon View Post
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.
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
wmcbrine is offline   Reply With Quote
Old 01-31-2013, 04:25 PM   #96
vanclute
Registered User
 
Join Date: Aug 2003
Posts: 137
Alas wmcbrine appears to be correct, no change with the latest version.
vanclute is offline   Reply With Quote
Old 02-05-2013, 07:45 PM   #97
vanclute
Registered User
 
Join Date: Aug 2003
Posts: 137
So are we at a dead on with this on Mac? I was so hopeful...
vanclute is offline   Reply With Quote
Old 02-05-2013, 10:28 PM   #98
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
Quote:
Originally Posted by vanclute View Post
So are we at a dead on with this on Mac? I was so hopeful...
I don't know how to correct your error. Someone with better knowledge of Python and Mac will need to help out.
Allanon is offline   Reply With Quote
Old 02-13-2013, 11:25 PM   #99
bradleys
It'll be fine....
 
Join Date: Oct 2007
Posts: 1,489
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.



But it was nice getting it to this point.
Attached Images
File Type: jpg tivopodcast.jpg (37.2 KB, 685 views)
__________________
TiVo S2 (Retired)
TiVo Series 3 (for sale)
TiVo HD (for sale)
TiVo Premier (2 TB Upgrade)
TiVo Roamio Plus
TiVo Mini
iPad TiVo app
TiVo Stream (Sold)
Personal Video Share powered by PyTiVo

Last edited by bradleys : 02-14-2013 at 12:09 AM.
bradleys is online now   Reply With Quote
Old 02-21-2013, 02:49 PM   #100
vanclute
Registered User
 
Join Date: Aug 2003
Posts: 137
That's great... now if only the videos would play for me in the first place.
vanclute is offline   Reply With Quote
Old 02-21-2013, 06:04 PM   #101
bradleys
It'll be fine....
 
Join Date: Oct 2007
Posts: 1,489
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.
__________________
TiVo S2 (Retired)
TiVo Series 3 (for sale)
TiVo HD (for sale)
TiVo Premier (2 TB Upgrade)
TiVo Roamio Plus
TiVo Mini
iPad TiVo app
TiVo Stream (Sold)
Personal Video Share powered by PyTiVo
bradleys is online now   Reply With Quote
Old 02-28-2013, 02:36 PM   #102
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
Here is an update that fixes file transfers. The problem is detailed in this thread:

http://www.tivocommunity.com/tivo-vb...d.php?t=501420.

This version added a cookie with sid='ABC'.
Attached Files
File Type: zip Tivo Proxy Server.zip (2.4 KB, 21 views)
Allanon is offline   Reply With Quote
Old 02-28-2013, 07:53 PM   #103
mulscully
Registered User
 
Join Date: May 2003
Location: Malvern, Pa
Posts: 291
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)


__________________
- 1 Tivo Premier "Elite" Stock.- monthly
- 2 Tivo HDs w/Motorola M Cable cards (Lifetime)
- 1 Verizon FIOS DVR

Last edited by mulscully : 02-28-2013 at 07:58 PM.
mulscully is offline   Reply With Quote
Old 03-01-2013, 12:23 AM   #104
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
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
File Type: zip Tivo Proxy Server.zip (2.6 KB, 9 views)
Allanon is offline   Reply With Quote
Old 03-01-2013, 09:58 AM   #105
mulscully
Registered User
 
Join Date: May 2003
Location: Malvern, Pa
Posts: 291
Thanks, I will give this a try sometime tonight or tomorrow and post the result....
__________________
- 1 Tivo Premier "Elite" Stock.- monthly
- 2 Tivo HDs w/Motorola M Cable cards (Lifetime)
- 1 Verizon FIOS DVR
mulscully is offline   Reply With Quote
Old 03-03-2013, 07:21 PM   #106
mulscully
Registered User
 
Join Date: May 2003
Location: Malvern, Pa
Posts: 291
Nah... still getting the same error... Believe its a win 7 issue....
__________________
- 1 Tivo Premier "Elite" Stock.- monthly
- 2 Tivo HDs w/Motorola M Cable cards (Lifetime)
- 1 Verizon FIOS DVR
mulscully is offline   Reply With Quote
Old 03-10-2013, 09:09 PM   #107
vanclute
Registered User
 
Join Date: Aug 2003
Posts: 137
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
----------------------------------------

vanclute is offline   Reply With Quote
Old 03-11-2013, 02:24 AM   #108
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
Vanclute, for some reason the last version didn't have the code that fixed your path problem. This version should work.
Attached Files
File Type: zip Tivo Proxy Server.zip (2.6 KB, 43 views)
Allanon is offline   Reply With Quote
Old 03-29-2013, 12:09 AM   #109
vanclute
Registered User
 
Join Date: Aug 2003
Posts: 137
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
----------------------------------------

vanclute is offline   Reply With Quote
Old 11-23-2013, 07:53 PM   #110
ligand
Registered User
 
Join Date: Jun 2010
Posts: 4
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!
ligand is offline   Reply With Quote
Old 12-22-2013, 06:02 PM   #111
berkinet
Registered User
 
Join Date: Dec 2013
Posts: 34
Quote:
Originally Posted by ligand View Post
...Compiled TivoDecode and copied to the same directory as the python script. Started the python script using sudo... Great Job!
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.
berkinet is offline   Reply With Quote
Old 12-23-2013, 12:58 AM   #112
berkinet
Registered User
 
Join Date: Dec 2013
Posts: 34
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()

berkinet is offline   Reply With Quote
Old 03-08-2014, 10:24 AM   #113
cyberweasel
Registered User
 
Join Date: Apr 2007
Posts: 6
Plex working?

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
cyberweasel is offline   Reply With Quote
Old 03-09-2014, 06:41 PM   #114
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
Quote:
Originally Posted by cyberweasel View Post
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
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.
Allanon is offline   Reply With Quote
Old 03-10-2014, 12:07 AM   #115
ppeewang
Registered User
 
Join Date: Aug 2012
Posts: 15
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 ?
ppeewang is offline   Reply With Quote
Old 03-10-2014, 02:27 AM   #116
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
Quote:
Originally Posted by ppeewang View Post
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 ?
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.
Allanon is offline   Reply With Quote
Old 03-10-2014, 10:19 AM   #117
ppeewang
Registered User
 
Join Date: Aug 2012
Posts: 15
Quote:
Originally Posted by Allanon View Post
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.

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!
ppeewang is offline   Reply With Quote
Old 03-10-2014, 11:31 AM   #118
Allanon
Registered User
 
Join Date: Nov 2005
Posts: 509
Quote:
Originally Posted by ppeewang View Post
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!
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.
Allanon is offline   Reply With Quote
Old 03-10-2014, 09:05 PM   #119
ppeewang
Registered User
 
Join Date: Aug 2012
Posts: 15
Thanks, I'll run this hard wired on a better system and see what happens. Was using a laptop wirelessly initially.
ppeewang is offline   Reply With Quote
Old 03-21-2014, 02:46 PM   #120
tlc
Registered User
 
Join Date: May 2002
Posts: 423
I'm seeing "Broken pipe" as well.
Quote:
Disconnect
----------------------------------------
Exception happened during processing of request from ('192.168.1.222', 48490)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 640, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 693, in finish
self.wfile.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
Print statement debugging puts it in the self.wfile.write(chunk) call.
__________________
"You want lifetime. The other plans are for suckers who can't do math." -- Bigg
tlc 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 07:15 PM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |