View Full Version : Tivo Proxy Server
Allanon
07-22-2012, 06:07 PM
Hi, I'm writing a simple proxy server for my TiVo that will stream and decode .tivo files directly from the TiVo. This will allow media players like VLC and media servers like TVersity to play and server the files. I am also going to server a RSS feed so media servers can find the Tivo files.
Right now I have a simple prototype that works with VLC:
import cgi, os, SocketServer, sys, time, subprocess
import urllib2
from SimpleHTTPServer import SimpleHTTPRequestHandler
from StringIO import StringIO
Tivo_MAK = '***********'
Tivo_URL = 'http://192.168.1.106'
Port = 8000
def findPID(exename):
a = os.popen4('tasklist /FI "IMAGENAME eq '+exename+'"')
a[0].flush()
try:
info=a[1].readlines()[3].split()
except:
info=[exename,"NotFound"]
return info[1]
class DirectoryHandler(SimpleHTTPRequestHandler):
def do_GET(self):
global Tivo_MAK
global Tivo_URL
# create TiVo URL
link = Tivo_URL + self.path
print link
# Send header
self.send_response(200)
self.send_header("Content-Type", "video/mpeg")
self.end_headers()
# Get and decode the Tivo file
decode = subprocess.Popen('curl.exe --digest -k -c cookies.txt -u tivo:{0:s} "{1:s}" | tivodecode -m {0:s} -- -'.format(Tivo_MAK,link),shell=True,bufsize=1000,stdout=subpr ocess.PIPE)
processID = findPID('curl.exe')
# send decoded data to the client
while True:
chunk = decode.stdout.read(4096)
if not chunk:
break
try:
self.wfile.write(chunk)
except:
os.popen('TASKKILL /PID '+ processID +' /F')
time.sleep(1)
break
httpd = SocketServer.TCPServer(("", Port), DirectoryHandler)
print "serving at port", Port
httpd.serve_forever()
With this running I can open VLC and pass an URL that looks like this:
http://192.168.1.100:8000/download/Auction%20Kings.tivo?Container=%2FNowPlaying&id=4707752&Format=video/x-tivo-mpeg
And the server will change the URL to the TiVo URL and run curl and tivodecode then pass the output back to VLC.
This works in VLC, but I can't get any other media player or media server to recognize the output. I think it's because they can't determine the codec to use, they will open and close the link a few times before saying it can't play. My question is what exactly is output from tivodecode and what content-type and header info should I send? I tried "video/mpeg","video/mp4","video/mpgv" but windows media player won't play the output.
wmcbrine
07-22-2012, 11:00 PM
The output from tivodecode should be an MPEG-2 program stream. I believe "video/mpeg" is the correct MIME type for this. But I don't know what other software besides VLC you've tried, what its capabilities are, or what it expects.
Allanon
07-22-2012, 11:52 PM
The output from tivodecode should be an MPEG-2 program stream. I believe "video/mpeg" is the correct MIME type for this. But I don't know what other software besides VLC you've tried, what its capabilities are, or what it expects.
I tried VLC, Windows Media Player and Serviio media server. VLC played the stream no mater what MIME was on the stream. And Serviio Media Server would only play the stream if it was designated as an internet stream and a MIME of "video/mpeg" but if the same exact URL was passed using an RSS feed it would not play. Windows Media Player would not play the stream at all. It starts the stream a few times then says it can't play it.
My goal is to stream videos from my TiVo to my Sony TV which has an UPNP/DLNA client. I would like to feed Serviio media server an RSS feed with proxy links to all the videos on the TiVo. Then I can use the UPNP/DLNA client to select videos and have them streamed using the proxy server. I don't want to store TiVo files on my computer.
Update:
I got RSS and video working with the PS3 Media Server. This media server satisfies all my media server needs so I am going to stop trying to get this proxy server working with other players and servers. I will post here the final code to my proxy server when it's complete.
ferrumpneuma
08-09-2012, 09:07 AM
I can't believe that works at all telfpountee.
Allanon
08-09-2012, 03:55 PM
Below is the final code that I'm using for the Tivo Proxy Server. It isn't pretty and doesn't do a lot of error checking but it works for me. You can use this code for whatever you like without restrictions.
To use just run the Tivo Proxy Server.py code then pass a URL that looks like this:
http://192.168.1.100:10000/rss
This assumes:
Server_URL = 192.168.1.100
Port = 10000
That url will return an RSS FEED to the specified Tivo's now playing list. The .tivo URLs in the RSS feed will point to the proxy server and when a .tivo file is requested the proxy server will download the .tivo file and convert it to an .mpg and stream it to the requesting application.
This has been tested with VLC and PS3 Media Server. I use this proxy server to stream videos from the TiVo to my Sony TV which has a UPNP / DNLA client which connect to the PS3 Media Server.
ejonesss
11-16-2012, 06:43 PM
after i set up the server i get invalid syntax at print link
i guess print is not a valid command
vanclute
01-10-2013, 08:41 PM
I just stumbled across this thread and am very intrigued to try this. I hope I'm doing something wrong because it doesn't seem to function at all for me.
I run the .py file in Terminal after editing it to include my MAK, Tivo IP, and server IP (my Mac media server which is running the .py script).
This is what I get:
users-Mac:~ user$ /Users/user/Desktop/Tivo\ Proxy\ Server.py ; exit;
/Users/user/Desktop/Tivo Proxy Server.py: line 1: import: command not found
from: can't read /var/mail/SimpleHTTPServer
from: can't read /var/mail/StringIO
: command not found/Tivo Proxy Server.py: line 4:
/Users/user/Desktop/Tivo Proxy Server.py: line 7: Tivo_MAK: command not found
/Users/user/Desktop/Tivo Proxy Server.py: line 8: Server_URL: command not found
/Users/user/Desktop/Tivo Proxy Server.py: line 9: Tivo_URL: command not found
/Users/user/Desktop/Tivo Proxy Server.py: line 10: Port: command not found
: command not found/Tivo Proxy Server.py: line 11:
: command not found/Tivo Proxy Server.py: line 12:
/Users/user/Desktop/Tivo Proxy Server.py: line 14: syntax error near unexpected token `('
'Users/user/Desktop/Tivo Proxy Server.py: line 14: `def findPID(exename):
logout
Any idea where I've gone wrong?
Allanon
01-10-2013, 09:55 PM
Any idea where I've gone wrong?
Only thing I can think of is to make sure you have all the modules installed. I'm not really a Python expert and I don't have a Mac. I taught myself how to program Python so there can be numerous things wrong with the code. It works on my Windows XP computer but I have no knowledge of how to get it working on other operating systems.
Also checkout this thread where I explain some of the problems other operating systems might have:
http://www.tivocommunity.com/tivo-vb/showthread.php?t=496286
wmcbrine
01-11-2013, 01:18 AM
Any idea where I've gone wrong?
It's treating it as a shell script rather than as Python. You can either launch it as "python scriptname", or add this as the first line:
#!/usr/bin/env python
vanclute
01-11-2013, 12:33 PM
Aha good point. OK I added the line, but now I get this:
users-Mac:~ user$ /Users/user/Desktop/Tivo\ Proxy\ Server.py ; exit;
Traceback (most recent call last):
File "/Users/user/Desktop/Tivo Proxy Server.py", line 121, in <module>
httpd = SocketServer.TCPServer(("", Port), Handler)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 408, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 419, in server_bind
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth
socket.error: [Errno 48] Address already in use
logout
[Process completed]
I quit PyTivoX in case that was conflicting but that didn't help.
Allanon
01-11-2013, 09:27 PM
Since there seemed to be some interest in this program I went ahead and made the code less OS dependent. I removed all Windows specific code such as the process ID check function and the need for curl.exe. I tested the program using Python 2.7. You will still need to place tivodecode (http://sourceforge.net/projects/tivodecode/) in the same path as the program. You can get a tivodecode binary file from kmttg's Helper Tools (http://code.google.com/p/kmttg/downloads/list). Also you will still need to replace the IP, port and MAK parameters located near the top of the code to reflect your computer and Tivo network settings.
vanclute
01-12-2013, 03:45 AM
You will still need to place tivodecode (http://sourceforge.net/projects/tivodecode/) in the same path as the program.
Aha! I missed this requirement and had not done so at all. Hopefully that, combined with your new OS-independence changes, will yield better results for me at last. I shall report back ASAP!
vanclute
01-12-2013, 03:52 AM
Well rats... no joy. :( Here is the result:
users-Mac:~ user$ /Applications/kmttg_v0p8u/tivodecode/Tivo\ Proxy\ Server\ 2.py ; exit;
Traceback (most recent call last):
File "/Applications/kmttg_v0p8u/tivodecode/Tivo Proxy Server 2.py", line 148, in <module>
httpd = SocketServer.TCPServer(("", Port), Handler)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 408, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 419, in server_bind
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth
socket.error: [Errno 48] Address already in use
logout
[Process completed]
Any suggestions on where to go from here?
Allanon
01-12-2013, 11:40 AM
Any suggestions on where to go from here?
Did you try changing the port number?
Edit:
I also went online to see if I can find a solution and you might try using this line of code:
Replace:
# Start Proxy Server
httpd = SocketServer.TCPServer(("", Port), Handler)
With:
# Start Proxy Server
SocketServer.TCPServer.allow_reuse_address = True
httpd = SocketServer.TCPServer(("", Port), Handler)
wmcbrine
01-12-2013, 12:47 PM
Yes, change the port number. (Don't do the reuse mod.)
bradleys
01-12-2013, 05:24 PM
I have the script running and I can see the rss feed. When I try to play the video in VLN I get nothing.
Looks properly formated...
"http://192.168.1.6:10000/download/Fringe.tivo?Container=%2FNowPlaying&id=2337518&Format=video/x-tivo-mpeg"
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=17898&d=1358040944
Is it possible we could have a DNLA server built into PyTiVo? :)
vanclute
01-12-2013, 07:49 PM
ok, progress! The server is now serving on port 10001 and I can see a list of programs on the tivo! Playing one however, still fails thusly:
Video URL: http://192.168.2.10/download/The%20Owl%20and%20the%20Pussycat.TiVo?Container=%2FNowPlayin g&id=1337050
192.168.2.16 - - [12/Jan/2013 17:50:29] "GET /download/The%20Owl%20and%20the%20Pussycat.TiVo?Container=%2FNowPlayin g&id=1337050 HTTP/1.1" 200 -
Decoding video
----------------------------------------
Exception happened during processing of request from ('192.168.2.16', 53674)
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 "/Applications/kmttg_v0p8u/tivodecode/Tivo Proxy Server 2.py", line 127, in do_GET
decode = subprocess.Popen('tivodecode -m {0:s} -- -'.format(Tivo_MAK),shell=False,bufsize=0,stdin=subprocess.PI PE,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
----------------------------------------
So it's missing something... can you tell what?
So close!
Also I notice it's showing only a handful of programs, certainly nowhere near everything that's on the Tivo.
bradleys
01-12-2013, 07:52 PM
ok, progress! The server is now serving on port 10001 and I can see a list of programs on the tivo! Playing one however, still fails thusly:
So it's missing something... can you tell what?
So close!
Also I notice it's showing only a handful of programs, certainly nowhere near everything that's on the Tivo.
Looks like you and I are seeing something very similar....
I am also only seeing a subset of the actual content on my TiVo in the RSS feed.
Video URL: http://192.168.1.7/download/Fringe.tivo?Container=%2FNowPlaying&id=2337518&Format=video/x-tivo-mpeg
HOME_OFFICE.home - - [12/Jan/2013 19:33:48] "GET /download/Fringe.tivo?Container=%2FNowPlaying&id=2337518&Format=video/x-tivo-mpeg HTTP/1.1" 200 -
Decoding video
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 57892)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 638, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 328, in handle_one_request
method()
File "C:\Program Files (x86)\TivoProxy\Tivo Proxy Server.py", line 125, in do_GET
decode = subprocess.Popen('tivodecode -m {0:s} -- -'.format(Tivo_MAK),shell=False,bufsize=0,stdin=subprocess.PI PE,stdout=subprocess.PIPE)
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 896, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
----------------------------------------
/
Definately looks like some file is not being found...
vanclute
01-12-2013, 08:22 PM
My first thought was that it's not finding something it needs from tivodecode, but I would have expected the error message to be a bit more specific if that were the case. I don't have any other theory at this moment. =(
bradleys
01-12-2013, 08:31 PM
That was my thought as well... So I tried placing the TiVodecode files in the root directory (C:\Program Files (x86)\TivoProxy) to see if that would help. It didn't.
I am sure we are doing something simple wrong.
Allanon
01-12-2013, 11:10 PM
The URL posted in the image looks different than the ones I'm getting. My URLs are formatted like this:
http://192.168.1.114:10000/download/NFL%20Football.TiVo?Container=%2FNowPlaying&id=5377217
Try removing the "&Format=video/x-tivo-mpeg" in your URL and see if it plays.
What type of Tivo do you guys have? I have a Tivo HD and I did a hack to convert the XML file from the Tivo to an RSS feed. If you guys have a Premiere then maybe the XML file is different and the hack is messing up. I will fix the code to use XMLLib and read the XML file properly.
Can someone post the XML Now Playing List from their Premiere so I can do a comparison?
Also, in VLC you can add the RSS feed as a podcast and have the Tivo Now Playing List show up in the VLC playlist. This will prevent you from having to enter the URLs manually.
bradleys
01-12-2013, 11:32 PM
I have an HD machine as well. And temper this with the knowlege that I am half a bottle down on a fantastic Cab tonight, but I am still not getting a result from the VLN player using:
http://192.168.1.114:10000/download/Grimm.TiVo?Container=%2FNowPlaying&id=2979432
let me see what I get from the console.....
serving at port 10000
/download/Gold%20Rush.TiVo?Container=%2FNowPlaying&id=1972195
Video URL: http://192.168.1.4/download/Gold%20Rush.TiVo?Container=%2FNowPlaying&id=1972195
HOME_OFFICE.home - - [12/Jan/2013 23:50:04] "GET /download/Gold%20Rush.TiVo?Container=%2FNowPlaying&id=1972195 HTTP/1.1" 200 -
Decoding video
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 50601)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 638, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 328, in handle_one_request
method()
File "C:\Program Files (x86)\TivoProxy\Tivo Proxy Server.py", line 125, in do_GET
decode = subprocess.Popen('tivodecode -m {0:s} -- -'.format(Tivo_MAK),shell=False,bufsize=0,stdin=subprocess.PI PE,stdout=subprocess.PIPE)
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 896, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
----------------------------------------
Same result from my HD, definately something I am doing wrong.
Allanon
01-13-2013, 12:14 AM
In this line of code:
decode = subprocess.Popen('tivodecode -m {0:s} -- -'.format(Tivo_MAK),shell=False,bufsize=0,stdin=subprocess.PI PE,stdout=subprocess.PIPE)
Try putting in the path to tivodecode, for example if tivodecode is in c:\tivodecode then make the code look like this:
decode = subprocess.Popen('c:\\tivodecode\\tivodecode -m {0:s} -- -'.format(Tivo_MAK),shell=False,bufsize=0,stdin=subprocess.PI PE,stdout=subprocess.PIPE)
Also make sure you are running as administrator, maybe it's an authorization problem. I'm using Windows XP and run as administrator. I tried running without tivodecode and got a different error than the one you posted so I'm not sure what is causing that error.
vanclute
01-13-2013, 01:37 AM
I've got a Premiere as well (actually two, but I wasn't going to broach the question of running two servers until I had at least one working!)
Try removing the "&Format=video/x-tivo-mpeg" in your URL and see if it plays.
I'm not sure what you meant there, as I don't have that in my URLs....?
I would gladly post the XML Now Playing list but I have no idea how to get it. If you can clue me in, I'll contribute what I can.
As for RSS feeds in VLC, I suspect that might be a Windows-only feature, I don't see anything relating to RSS feeds at all in VLC for Mac.
I'll try the absolute path to tivodecode, I considered that but wasn't sure of the syntax. Will give it a shot and report back!
vanclute
01-13-2013, 01:44 AM
No change by adding the absolute path to Tivodecode. I think that part is at least working, it looks like maybe something about my python build is the problem. Apple includes python on the OS but maybe I need to try downloading a binary or something. I'm going to investigate that.
Allanon
01-13-2013, 02:24 AM
I've got a Premiere as well (actually two, but I wasn't going to broach the question of running two servers until I had at least one working!)
You can probably run 2 or more servers at a time just use different port numbers. But your computer is probably not fast enough to decode 2 HD videos at the same time. Mine has trouble just decoding one HD video.
I'm not sure what you meant there, as I don't have that in my URLs....?
The URL Bradleys posted had that at the end.
I would gladly post the XML Now Playing list but I have no idea how to get it. If you can clue me in, I'll contribute what I can.
To get the XML file just enter the following in to your internet browser. I used the Tivo URL from your error message but if that is not correct then change the URL to what it should be:
https://192.168.2.16/TiVoConnect?Command=QueryContainer&Container=%2FNowPlaying&Recurse=Yes&AnchorOffset=0
Then it should ask for a username and password, use the word tivo as the username and your Tivo MAK number as the password. Your browser should then display the Tivo XML file. Just save it to a file and post it here or send it as a private message.
As for RSS feeds in VLC, I suspect that might be a Windows-only feature, I don't see anything relating to RSS feeds at all in VLC for Mac.
Go to your playlist and on the left side it should have a menu item that says internet. Click that and you should see a podcast option. Just add the RSS Feed URL as a new podcast. If you don't see that then maybe it is only Windows.
wmcbrine
01-13-2013, 04:57 AM
No change by adding the absolute path to Tivodecode. I think that part is at least working, it looks like maybe something about my python build is the problem. Apple includes python on the OS but maybe I need to try downloading a binary or something. I'm going to investigate that.
No, that part is NOT working. And there is nothing wrong with your Python.
subprocess.Popen() expects a list, with the command and parameters separate, not a simple string:
['tivodecode', '-m', TiVo_MAK, '--', '-']
not
'tivodecode -m etc.'
It only works as a string in Windows, due to a quirk in how Popen is implemented there.
http://docs.python.org/2/library/subprocess.html#popen-constructor
Allanon
01-13-2013, 06:20 AM
Thanks wmcbrine for pointing that out, I would have never found that.
Alright, here is an updated version. This version includes the modification wmcbrine posted and the program now uses XMLLib to parse the XML file which might work better if the Tivo HD and Premiere XML files are different. I also added more context headers, this seems to have made the video play on more devices such as within the Chrome browser and in the Serviio Media Server.
bradleys
01-13-2013, 09:07 AM
Running the RSS in Chrome I now get the error:
This page contains the following errors:
error on line 31 at column 49: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=17908&d=1358089693
Trying to run in VLN and I get:
serving at port 10000
/download/Gold%20Rush.TiVo?Container=%2FNowPlaying&id=1972195&Format=video/x-tivo-mpeg
Video URL: http://192.168.1.7/download/Gold%20Rush.TiVo?Container=%2FNowPlaying&id=1972195&Format=video/x-tivo-mpeg
HOME_OFFICE.home - - [13/Jan/2013 09:27:58] "GET /download/Gold%20Rush.TiVo?Container=%2FNowPlaying&id=1972195&Format=video/x-tivo-mpeg HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 53074)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 638, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 328, in handle_one_request
method()
File "C:\Program Files (x86)\TivoProxy\Tivo Proxy Server.py", line 155, in do_GET
videoFile = openUrl(link, 'tivo', Tivo_MAK)
File "C:\Program Files (x86)\TivoProxy\Tivo Proxy Server.py", line 25, in openUrl
return urllib2.urlopen(url)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 406, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 444, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
----------------------------------------
Allanon
01-13-2013, 12:24 PM
Bradleys, what type of Tivo are you using to test this program? Also, can you send me the XML file from your Tivo so I can write code that reads it?
Your Tivo video URL is different than the one from my Tivo HD. Plus the RSS Feed error doesn't happen on my Tivo. There is something different about your XML file. Do you live in the United States? Maybe non US boxes have different XML Files. I can't help until I see what your XML file looks like.
bradleys
01-13-2013, 02:19 PM
Bradleys, what type of Tivo are you using to test this program? Also, can you send me the XML file from your Tivo so I can write code that reads it?
Your Tivo video URL is different than the one from my Tivo HD. Plus the RSS Feed error doesn't happen on my Tivo. There is something different about your XML file. Do you live in the United States? Maybe non US boxes have different XML Files. I can't help until I see what your XML file looks like.
I have a Premier, an HD and an S3, I am testing against the Premier. Let me give it a try against the HD. I am in Dallas.
The new file does not work against any of my TiVo's. Attached is the XML from my Premier box
vanclute
01-13-2013, 02:41 PM
To get the XML file just enter the following in to your internet browser. I used the Tivo URL from your error message but if that is not correct then change the URL to what it should be:
https://192.168.2.16/TiVoConnect?Command=QueryContainer&Container=%2FNowPlaying&Recurse=Yes&AnchorOffset=0
Then it should ask for a username and password, use the word tivo as the username and your Tivo MAK number as the password. Your browser should then display the Tivo XML file. Just save it to a file and post it here or send it as a private message.
wow... my server REALLY did not like that. I added the port number to the URL and then got this:
192.168.2.16 - - [13/Jan/2013 12:42:33] code 400, message Bad request syntax ('\x16\x03\x01\x00\x8f\x01\x00\x00\x8b\x03\x01P\xf3\x1c9)\xa 9\x84&\x86\x86\xd3\xb5\xd3\x13fn9s\xbcR\xbc\x05\xb3|\x12\x17\xd8\x dd\xbc\xaf\xe6\x02\x00\x00H\x00\xff\xc0')
192.168.2.16 - - [13/Jan/2013 12:42:33] "??P?9)??&??ӵ?fn9s?R??|?ݼ??H??" 400 -
192.168.2.16 - - [13/Jan/2013 12:42:33] code 400, message Bad request syntax ('\x16\x03\x01\x00\x8f\x01\x00\x00\x8b\x03\x01P\xf3\x1c9\xe5 \x83t-\x7f\x1e"\xe9\x9dI\xf9;\xb2)\x8cwts(\x13#\xf0P\xb7\x83"6Y\x00\x00H\x00\xff\xc0')
192.168.2.16 - - [13/Jan/2013 12:42:33] "??P?9?t-"?I?;?)?wts(#?P??"6YH??" 400 -
The exact URL I used was:
https://192.168.2.16:10001/TiVoConnect?Command=QueryContainer&Container=%2FNowPlaying&Recurse=Yes&AnchorOffset=0
suggestions?
Allanon
01-13-2013, 04:37 PM
wow... my server REALLY did not like that.
That URL has nothing to do with my program. It just retrieves the XML Now Playing List from your Tivo. Don't add a port number and use your Tivo URL not your computer's URL.
Allanon
01-13-2013, 04:48 PM
I have a Premier, an HD and an S3, I am testing against the Premier. Let me give it a try against the HD. I am in Dallas.
The new file does not work against any of my TiVo's. Attached is the XML from my Premier box
Thanks for the file, it looks almost identical to the Tivo HD XML. Not sure why it's not working. I'm going to try the code on Linux to see if I get different results. Will report back later tonight.
BTW, what OS are you running?
bradleys
01-13-2013, 06:16 PM
Thanks for the file, it looks almost identical to the Tivo HD XML. Not sure why it's not working. I'm going to try the code on Linux to see if I get different results. Will report back later tonight.
BTW, what OS are you running?
Windows 7. As I said, the ealier file you created generates a readable RSS feed, but fails on the transcode. The last file you created fails on the RSS feed for me.
I have both TiVo decode and your file extracted to the same directory. I have Python 2.7.3 installed.
Allanon
01-13-2013, 11:03 PM
Here is an updated version that should fix the RSS Feed. There was an & in the episode title and apparently browsers don't like the & character so it has to be replaced with &. I was doing that for the URL but not for any of the other data so an error was produced. This is now fixed.
I also noticed that the program wasn't putting the port number in the Video URL so I placed port 80 in the URL. Maybe Windows 7 needs the port number.
bradleys
01-14-2013, 08:53 AM
Here is an updated version that should fix the RSS Feed. There was an & in the episode title and apparently browsers don't like the & character so it has to be replaced with &. I was doing that for the URL but not for any of the other data so an error was produced. This is now fixed.
I also noticed that the program wasn't putting the port number in the Video URL so I placed port 80 in the URL. Maybe Windows 7 needs the port number.
Yes, those special characters! - I struggled with those when I developed my poster art lookup logic. The RSS is working but still failing with the '&' in Angels & Demons. If I delete that movie, it works fine.
Unfortunately, it is still not working. I am sure you are getting a little tired of trouble shooting this. If you are still interested, I am attaching my code - this is the same output if I run it via firefox or input the url into VLN.
Video URL: http://192.168.1.7:80/download/MuscleCar.TiVo?Container=%2FNowPlaying&id=4404019200&Format=video/x-tivo-mpeg
HOME_OFFICE.home - - [14/Jan/2013 17:36:07] "GET /download/MuscleCar.TiVo?Container=%2FNowPlaying&id=4404019200&Format=video/x-tivo-mpeg HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 58127)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 638, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 328, in handle_one_request
method()
File "C:\Program Files (x86)\TivoProxy\Tivo Proxy Server.py", line 154, in do_GET
videoFile = openUrl(link, 'tivo', Tivo_MAK)
File "C:\Program Files (x86)\TivoProxy\Tivo Proxy Server.py", line 25, in openUrl
return urllib2.urlopen(url)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 406, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 444, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
----------------------------------------
If I get this working the next step is to try to feed this to my Plex Media Server using the feed me plugin. With that you can stream to Roku boxes, xbox... Heck, any number of devices.
vanclute
01-15-2013, 12:33 AM
That URL has nothing to do with my program. It just retrieves the XML Now Playing List from your Tivo. Don't add a port number and use your Tivo URL not your computer's URL.
Ahh I see, my mistake. Here is the output:
<TiVoContainer><Details><ContentType>x-tivo-container/tivo-videos</ContentType><SourceFormat>x-tivo-container/tivo-dvr</SourceFormat><Title>Now Playing</Title><LastChangeDate>0x50F4F768</LastChangeDate><TotalItems>430</TotalItems><UniqueId>/NowPlaying</UniqueId></Details><SortOrder>Type,CaptureDate</SortOrder><GlobalSort>Yes</GlobalSort><ItemStart>0</ItemStart><ItemCount>16</ItemCount><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>The Owl and the Pussycat</Title><SourceSize>4404019200</SourceSize><Duration>7198000</Duration><CaptureDate>0x50F1C0BE</CaptureDate><ShowingDuration>7200000</ShowingDuration><ShowingStartTime>0x50F1C0C0</ShowingStartTime><Description>An uptight would-be writer shares a New York apartment with a part-time prostitute. Copyright Tribune Media Services, Inc.</Description><SourceChannel>186</SourceChannel><SourceStation>KNTVDT2</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV000077810000</ProgramId><SeriesId>MV007781</SeriesId><StreamingPermission>Yes</StreamingPermission><TvRating>3</TvRating><MpaaRating>2</MpaaRating><ShowingBits>1</ShowingBits><SourceType>2</SourceType><IdGuideSource>36151</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/The%20Owl%20and%20the%20Pussycat.TiVo?Container=%2FNowPlayin g&id=1337050</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1337050</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Pop Up Video</Title><SourceSize>2202009600</SourceSize><Duration>1799000</Duration><CaptureDate>0x50F14936</CaptureDate><ShowingDuration>1800000</ShowingDuration><ShowingStartTime>0x50F14938</ShowingStartTime><EpisodeTitle>Celeb Cameos</EpisodeTitle><SourceChannel>44</SourceChannel><SourceStation>VH1P</SourceStation><HighDefinition>No</HighDefinition><ProgramId>EP014764110078</ProgramId><SeriesId>SH01476411</SeriesId><EpisodeNumber>206</EpisodeNumber><StreamingPermission>Yes</StreamingPermission><TvRating>4</TvRating><ShowingBits>786946</ShowingBits><SourceType>2</SourceType><IdGuideSource>16376</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/Pop%20Up%20Video.TiVo?Container=%2FNowPlaying&id=1337184</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:save-until-i-delete-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1337184</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Little Miss Marker</Title><SourceSize>2202009600</SourceSize><Duration>5400000</Duration><CaptureDate>0x50F0996E</CaptureDate><ShowingDuration>5400000</ShowingDuration><ShowingStartTime>0x50F09970</ShowingStartTime><Description>Bookie Sorrowful Jones receives a little girl as an IOU in the Damon Runyon tale. Copyright Tribune Media Services, Inc.</Description><SourceChannel>186</SourceChannel><SourceStation>KNTVDT2</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV000031060000</ProgramId><SeriesId>MV003106</SeriesId><StreamingPermission>Yes</StreamingPermission><TvRating>4</TvRating><MpaaRating>8</MpaaRating><ShowingBits>0</ShowingBits><SourceType>2</SourceType><IdGuideSource>36151</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/Little%20Miss%20Marker.TiVo?Container=%2FNowPlaying&id=1337049</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1337049</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>The Millionaire Matchmaker</Title><SourceSize>2202009600</SourceSize><Duration>3599000</Duration><CaptureDate>0x50EF9C4E</CaptureDate><ShowingDuration>3600000</ShowingDuration><ShowingStartTime>0x50EF9C50</ShowingStartTime><EpisodeTitle>Wounded Wally and the Mama's Boy</EpisodeTitle><Description>Daniel Negreanu is a 37-year-old professional poker player; Brian Holloway II is a divorced heir to his family's fortune. Copyright Tribune Media Services, Inc.</Description><SourceChannel>48</SourceChannel><SourceStation>BRAVOP</SourceStation><HighDefinition>No</HighDefinition><ProgramId>EP010175710066</ProgramId><SeriesId>SH01017571</SeriesId><EpisodeNumber>601</EpisodeNumber><StreamingPermission>Yes</StreamingPermission><TvRating>5</TvRating><ShowingBits>2</ShowingBits><SourceType>2</SourceType><IdGuideSource>31555</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/The%20Millionaire%20Matchmaker.TiVo?Container=%2FNowPlaying&id=1336029</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1336029</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Highway to Heaven</Title><SourceSize>2202009600</SourceSize><Duration>3599000</Duration><CaptureDate>0x50EE128E</CaptureDate><ShowingDuration>3600000</ShowingDuration><ShowingStartTime>0x50EE1290</ShowingStartTime><EpisodeTitle>Popcorn, Peanuts and Cracker Jacks</EpisodeTitle><Description>When Jonathan is called away, Mark visits his former partner and uncovers a family secret; guest Shannen Doherty. Copyright Tribune Media Services, Inc.</Description><SourceChannel>186</SourceChannel><SourceStation>KNTVDT2</SourceStation><HighDefinition>No</HighDefinition><ProgramId>EP000020920031</ProgramId><SeriesId>SH002092</SeriesId><EpisodeNumber>7856</EpisodeNumber><StreamingPermission>Yes</StreamingPermission><TvRating>4</TvRating><ShowingBits>513</ShowingBits><SourceType>2</SourceType><IdGuideSource>36151</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/Highway%20to%20Heaven.TiVo?Container=%2FNowPlaying&id=1337048</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1337048</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>The Brass Bottle</Title><SourceSize>4404019200</SourceSize><Duration>7198000</Duration><CaptureDate>0x50EDF66E</CaptureDate><ShowingDuration>7200000</ShowingDuration><ShowingStartTime>0x50EDF670</ShowingStartTime><Description>An architect finds an old bottle, out of which comes a genie eager to do his bidding. Copyright Tribune Media Services, Inc.</Description><SourceChannel>186</SourceChannel><SourceStation>KNTVDT2</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV000051870000</ProgramId><SeriesId>MV005187</SeriesId><StreamingPermission>Yes</StreamingPermission><TvRating>4</TvRating><MpaaRating>8</MpaaRating><ShowingBits>0</ShowingBits><SourceType>2</SourceType><IdGuideSource>36151</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/The%20Brass%20Bottle.TiVo?Container=%2FNowPlaying&id=1337047</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1337047</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Madame X</Title><SourceSize>4404019200</SourceSize><Duration>7198000</Duration><CaptureDate>0x50EDDA4E</CaptureDate><ShowingDuration>7200000</ShowingDuration><ShowingStartTime>0x50EDDA50</ShowingStartTime><Description>A young lawyer defends an alcoholic woman accused of murder, unaware that she is his mother. Copyright Tribune Media Services, Inc.</Description><SourceChannel>186</SourceChannel><SourceStation>KNTVDT2</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV000025610000</ProgramId><SeriesId>MV002561</SeriesId><StreamingPermission>Yes</StreamingPermission><TvRating>4</TvRating><MpaaRating>8</MpaaRating><ShowingBits>0</ShowingBits><SourceType>2</SourceType><IdGuideSource>36151</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/Madame%20X.TiVo?Container=%2FNowPlaying&id=1337046</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1337046</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>The Millionaire Matchmaker</Title><SourceSize>2202009600</SourceSize><Duration>3598000</Duration><CaptureDate>0x50EDA20E</CaptureDate><ShowingDuration>3600000</ShowingDuration><ShowingStartTime>0x50EDA210</ShowingStartTime><EpisodeTitle>Dateapause</EpisodeTitle><Description>A globetrotting DJ and a mother of four search for matches. Copyright Tribune Media Services, Inc.</Description><SourceChannel>48</SourceChannel><SourceStation>BRAVOP</SourceStation><HighDefinition>No</HighDefinition><ProgramId>EP010175710037</ProgramId><SeriesId>SH01017571</SeriesId><EpisodeNumber>405</EpisodeNumber><StreamingPermission>Yes</StreamingPermission><TvRating>5</TvRating><ShowingBits>514</ShowingBits><SourceType>2</SourceType><IdGuideSource>31555</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/The%20Millionaire%20Matchmaker.TiVo?Container=%2FNowPlaying&id=1335933</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1335933</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Adventure in Baltimore</Title><SourceSize>3953131520</SourceSize><Duration>6300000</Duration><CaptureDate>0x50E69D92</CaptureDate><ShowingDuration>6300000</ShowingDuration><ShowingStartTime>0x50E69D94</ShowingStartTime><Description>A minister's teenage daughter grows up, gains a suitor and speaks out for women's rights. Copyright Tribune Media Services, Inc.</Description><SourceChannel>501</SourceChannel><SourceStation>TCM</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV000087180000</ProgramId><SeriesId>MV008718</SeriesId><StreamingPermission>Yes</StreamingPermission><MpaaRating>8</MpaaRating><ShowingBits>0</ShowingBits><SourceType>2</SourceType><IdGuideSource>12852</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/Adventure%20in%20Baltimore.TiVo?Container=%2FNowPlaying&id=1336373</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1336373</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Upside.Down.2012.BRRIP.XVID-AC3-PULSAR</Title><CopyProtected>Yes</CopyProtected><SourceSize>4278190080</SourceSize><Duration>6466000</Duration><CaptureDate>0x50E68505</CaptureDate><ShowingDuration>6420000</ShowingDuration><ShowingStartTime>0x50E68504</ShowingStartTime><EpisodeTitle>Upside.Down.2012.BRRIP.XVID-AC3-PULSAR</EpisodeTitle><Description>Upside.Down.2012.BRRIP.XVID-AC3-PULSAR Copyright Tribune Media Services, Inc.</Description><HighDefinition>No</HighDefinition><ProgramId>BS15000171</ProgramId><SeriesId>BS1430576535</SeriesId><StreamingPermission>Yes</StreamingPermission><ShowingBits>0</ShowingBits></Details><Links><Content><Url>http://192.168.2.10:80/download/Upside.Down.2012.BRRIP.XVID-AC3-PULSAR.TiVo?Container=%2FNowPlaying&id=1336589</Url><ContentType>video/x-tivo-raw-tts</ContentType><Available>No</Available></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1336589</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Step.Brothers[2008][Unrated.Edition]DvDrip-ColinWithaT</Title><CopyProtected>Yes</CopyProtected><SourceSize>1929379840</SourceSize><Duration>6335000</Duration><CaptureDate>0x50E682F1</CaptureDate><ShowingDuration>6300000</ShowingDuration><ShowingStartTime>0x50E682EF</ShowingStartTime><EpisodeTitle>Step.Brothers[2008][Unrated.Edition]DvDrip-ColinWithaT</EpisodeTitle><Description>Step.Brothers[2008][Unrated.Edition]DvDrip-ColinWithaT Copyright Tribune Media Services, Inc.</Description><HighDefinition>No</HighDefinition><ProgramId>BS15000161</ProgramId><SeriesId>BS988614116</SeriesId><StreamingPermission>Yes</StreamingPermission><ShowingBits>0</ShowingBits></Details><Links><Content><Url>http://192.168.2.10:80/download/Step.Brothers%5B2008%5D%5BUnrated.Edition%5DDvDrip-ColinWithaT.TiVo?Container=%2FNowPlaying&id=1336588</Url><ContentType>video/x-tivo-raw-tts</ContentType><Available>No</Available></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1336588</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Little Girl Lost: The Delimar Vera Story</Title><SourceSize>2202009600</SourceSize><Duration>7199000</Duration><CaptureDate>0x50E67DEE</CaptureDate><ShowingDuration>7200000</ShowingDuration><ShowingStartTime>0x50E67DF0</ShowingStartTime><Description>A woman who lost her daughter in a fire tries to prove that a young girl is the same child. Copyright Tribune Media Services, Inc.</Description><SourceChannel>504</SourceChannel><SourceStation>LMN</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV002286640000</ProgramId><SeriesId>MV228664</SeriesId><StreamingPermission>Yes</StreamingPermission><TvRating>4</TvRating><MpaaRating>8</MpaaRating><ShowingBits>1</ShowingBits><SourceType>2</SourceType><IdGuideSource>18480</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/Little%20Girl%20Lost%20The%20Delimar%20Vera%20Story.TiVo?Con tainer=%2FNowPlaying&id=1336585</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1336585</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>I'll Be Seeing You</Title><SourceSize>3282042880</SourceSize><Duration>5397000</Duration><CaptureDate>0x50E668DB</CaptureDate><ShowingDuration>5400000</ShowingDuration><ShowingStartTime>0x50E668D8</ShowingStartTime><Description>A woman on leave from prison meets a shellshocked veteran on furlough, and they fall in love at Christmas. Copyright Tribune Media Services, Inc.</Description><SourceChannel>501</SourceChannel><SourceStation>TCM</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV000009860000</ProgramId><SeriesId>MV000986</SeriesId><StreamingPermission>Yes</StreamingPermission><MpaaRating>8</MpaaRating><ShowingBits>0</ShowingBits><SourceType>2</SourceType><IdGuideSource>12852</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/I'll%20Be%20Seeing%20You.TiVo?Container=%2FNowPlaying&id=1334494</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1334494</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Weekend for Three</Title><SourceSize>2202009600</SourceSize><Duration>4500000</Duration><CaptureDate>0x50E617FA</CaptureDate><ShowingDuration>4500000</ShowingDuration><ShowingStartTime>0x50E617FC</ShowingStartTime><Description>A loud friend gets too friendly and wears out his welcome in a couple's home. Copyright Tribune Media Services, Inc.</Description><SourceChannel>501</SourceChannel><SourceStation>TCM</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV000166700000</ProgramId><SeriesId>MV016670</SeriesId><StreamingPermission>Yes</StreamingPermission><MpaaRating>8</MpaaRating><ShowingBits>0</ShowingBits><SourceType>2</SourceType><IdGuideSource>12852</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/Weekend%20for%20Three.TiVo?Container=%2FNowPlaying&id=1336372</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1336372</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>Chelsea Lately</Title><SourceSize>2202009600</SourceSize><Duration>1796000</Duration><CaptureDate>0x50E54186</CaptureDate><ShowingDuration>1800000</ShowingDuration><ShowingStartTime>0x50E54188</ShowingStartTime><Description>Christina Aguilera; Blake Shelton; Adam Levine. Copyright Tribune Media Services, Inc.</Description><SourceChannel>64</SourceChannel><SourceStation>EP</SourceStation><HighDefinition>No</HighDefinition><ProgramId>EP009387531133</ProgramId><SeriesId>SH938753</SeriesId><StreamingPermission>Yes</StreamingPermission><TvRating>5</TvRating><ShowingBits>852480</ShowingBits><SourceType>2</SourceType><IdGuideSource>17561</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/Chelsea%20Lately.TiVo?Container=%2FNowPlaying&id=1335625</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1335625</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item><Item><Details><ContentType>video/x-tivo-raw-tts</ContentType><SourceFormat>video/x-tivo-raw-tts</SourceFormat><Title>The Squall</Title><SourceSize>2202009600</SourceSize><Duration>7200000</Duration><CaptureDate>0x50E528EA</CaptureDate><ShowingDuration>7200000</ShowingDuration><ShowingStartTime>0x50E528EC</ShowingStartTime><Description>A gypsy woman applies her feminine charms to the male members of a farmhouse where she takes refuge during a storm. Copyright Tribune Media Services, Inc.</Description><SourceChannel>501</SourceChannel><SourceStation>TCM</SourceStation><HighDefinition>No</HighDefinition><ProgramId>MV000419870000</ProgramId><SeriesId>MV041987</SeriesId><StreamingPermission>Yes</StreamingPermission><MpaaRating>8</MpaaRating><ShowingBits>0</ShowingBits><SourceType>2</SourceType><IdGuideSource>12852</IdGuideSource></Details><Links><Content><Url>http://192.168.2.10:80/download/The%20Squall.TiVo?Container=%2FNowPlaying&id=1336371</Url><ContentType>video/x-tivo-raw-tts</ContentType></Content><CustomIcon><Url>urn:tivo:image:expired-recording</Url><ContentType>image/*</ContentType><AcceptsParams>No</AcceptsParams></CustomIcon><TiVoVideoDetails><Url>https://192.168.2.10:443/TiVoVideoDetails?id=1336371</Url><ContentType>text/xml</ContentType><AcceptsParams>No</AcceptsParams></TiVoVideoDetails></Links></Item></TiVoContainer>
Hope it's helpful!
Allanon
01-15-2013, 01:54 AM
Vanclute, thanks for the data, it's always good to get more data to test. Did you try the latest version of the program? Are you still having problems?
Bradleys, I have no idea why the "&Format=video/x-tivo-mpeg" is being added to the end of your URL. I tested the XML File you gave me and it doesn't append that to the end. That XML file doesn't even have "&Format=" located in it. Today I will have access to a Windows 7 computer and I will test to see if I can reproduce the error. You might try removing the "&Format" part of the URL and see if that works. If it does then I can just remove it before opening the URL.
bradleys
01-15-2013, 09:19 AM
Vanclute, thanks for the data, it's always good to get more data to test. Did you try the latest version of the program? Are you still having problems?
Bradleys, I have no idea why the "&Format=video/x-tivo-mpeg" is being added to the end of your URL. I tested the XML File you gave me and it doesn't append that to the end. That XML file doesn't even have "&Format=" located in it. Today I will have access to a Windows 7 computer and I will test to see if I can reproduce the error. You might try removing the "&Format" part of the URL and see if that works. If it does then I can just remove it before opening the URL.
From your first post:
http://192.168.1.100:8000/download/Auction%20Kings.tivo?Container=%2FNowPlaying&id=4707752&Format=video/x-tivo-mpeg
I am sorry, that was based on the origional format from your first post. I have tried it with and without the "&Format="... Let me try it again tonight without. Sorry if I missed something.
Allanon
01-15-2013, 12:34 PM
You should be using the unmodified URLs from the RSS feed that you get when you enter:
http://<Server_URL>:<Port>/rss
Server_URL and Port should be the same as what you set in the code.
I know Firefox doesn't show the urls in the RSS Feed but on my computer. I can click the listed .tivo link and have them play in Firefox. Or you can right click on the .tivo link and save the location and paste it in to VLC. View the page source to see the actual RSS Feed that was sent from my program. Chrome and IE show the actual RSS Feed code and you can just copy and paste.
Also, hope I don't sound frustrated or angry in my posts because I'm not. I enjoy programming and I really want to find this error and help you get it working. I have other feature ideas for this program so I would really want this to work on everyone's computer before going forward.
Edit:
I just tested the program on a Windows 7 computer and it worked fine without modifications.
vanclute
01-15-2013, 02:47 PM
I did try the latest version, here's my result of pulling the RSS feed (get only a partial list) and clicking a link which tries to open in VLC:
192.168.2.16 - - [15/Jan/2013 12:48:56] "GET /rss HTTP/1.1" 200 -
RSS Feed Send
/download/I%27ll%20Be%20Seeing%20You.TiVo?Container=%2FNowPlaying&id=1334494
Video URL: http://192.168.2.10:80/download/I%27ll%20Be%20Seeing%20You.TiVo?Container=%2FNowPlaying&id=1334494
192.168.2.16 - - [15/Jan/2013 12:49:07] "GET /download/I%27ll%20Be%20Seeing%20You.TiVo?Container=%2FNowPlaying&id=1334494 HTTP/1.1" 200 -
Decoding video
----------------------------------------
Exception happened during processing of request from ('192.168.2.16', 50824)
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 343, in handle
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 331, in handle_one_request
File "/Volumes/iMac Storage/Downloads/kmttg_MacOSX_tools_v0p8l/tivodecode/Tivo Proxy Server 4.py", line 162, in do_GET
decode = subprocess.Popen(['tivodecode', '-m', Tivo_MAK, '--', '-'],shell=False,bufsize=0,stdin=subprocess.PIPE,stdout=subproce ss.PIPE)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228, in _execute_child
OSError: [Errno 2] No such file or directory
----------------------------------------
So still no joy. Ideas?
Allanon
01-15-2013, 03:09 PM
So still no joy. Ideas?
That error occurs when the program can't find tivodecode. Do you have tivodecode in the same folder and the program?
bradleys
01-15-2013, 03:24 PM
I am going to start over tonight with a complete reinstall. But I want to duplicate your setup.
Can you tell me where you installed TivoProxy:
C:\Program Files (x86)\TivoProxy\
Where you installed Tivodecode:
C:\Program Files (x86)\TivoProxy\tivodecode\
Where you installed python:
C:\Python27\
Allanon
01-15-2013, 03:50 PM
I am going to start over tonight with a complete reinstall. But I want to duplicate your setup.
Can you tell me where you installed TivoProxy:
C:\Program Files (x86)\TivoProxy\
Where you installed Tivodecode:
C:\Program Files (x86)\TivoProxy\tivodecode\
Where you installed python:
C:\Python27\
I have Python in the c:\Python27 folder and for easy access I placed the "Tivo Proxy Server.py" and tivodecode.exe files on my desktop, but you can place them in any folder you like. I also have a batch file that looks like this:
Tivo Proxy Server.bat:
mode 150,10000
c:\python27\python.exe "Tivo Proxy Server.py"
pause
This is optional, I use it because it makes debugging the program easier. The pause command keeps the command window open when an error occurs.
bradleys
01-15-2013, 04:29 PM
I will show you what I am getting:
I placed Tivo Proxy Server.py and Tivodecode on the desktop in a directory called Tivoproxy. This time I extracted Tivodecode into the directory tivodecode-0.2pre4 under Tivoproxy. Last time I extracted it directly into the directory. Same outcome. I edited Tivo Proxy Server.py and updated the params thusly:
Tivo_MAK = 'mymak'
Server_URL = '192.168.1.6'
Tivo_URL = '192.168.1.7'
Port = 10000
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=17923&d=1358288904
Right Click Tivo Proxy Server.py -> Open with -> Python and the console registers Serving at Port 10000
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=17924&d=1358288911
Open the URL: http://192.168.1.6:10000/rss in firefox and I get the RSS feed in xml form.
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=17925&d=1358288918
bradleys
01-15-2013, 04:36 PM
I then try to open a url in firefox formatted in this way: http://192.168.1.6:10000/download/Face%20Off.TiVo?Container=%2FNowPlaying&id=2338141
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=17926&d=1358289367
And get a result in the python console showing the error:
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=17927&d=1358289375
I get the exact same results running via VLN
vanclute
01-15-2013, 06:45 PM
That error occurs when the program can't find tivodecode. Do you have tivodecode in the same folder and the program?
Yep sure do, this server script is in the tivodecode directory.
Allanon
01-15-2013, 07:06 PM
Bradleys, try running the program as administrator. Also try coping the URL from the RSS feed and pasting it in to VLC. The video doesn't play in every video player. My Firefox browser shows a VLC logo instead of a Quicktime logo when playing the video in the browser.
Vanclute, I'm unfamiliar with Mac's OS so I really don't know what is causing the problem. Maybe someone with Mac experience and Python knowledge can step in and help?
vanclute
01-15-2013, 08:24 PM
Yeah I feel like it's a python issue but I have almost no experience with it at all. I do PHP development so it doesn't look totally unfamiliar but it's different enough to have me stumped. I did install the latest python version but that doesn't seem to have helped.
bradleys
01-15-2013, 09:29 PM
OK, I created a batch file and ran it as administrator in VLN:
Still does not work, but the error code looks a little different. Personally, I think it is having problems finding tivodecode...
C:\Windows\system32>c:\python27\python.exe "C:\Users\Scott\Desktop\TivoProxy\Tivo Proxy Server.py"
serving at port 10000
/rss
HOME_OFFICE.home - - [15/Jan/2013 21:27:58] "GET /rss HTTP/1.1" 200 -
RSS Feed Send
/favicon.ico
/download/The%20Big%20Bang%20Theory.TiVo?Container=%2FNowPlaying&id=2338150
Video URL: http://192.168.1.7:80/download/The%20Big%20Bang%20Theory.TiVo?Container=%2FNowPlaying&id=2338150
HOME_OFFICE.home - - [15/Jan/2013 21:28:10] "GET /download/The%20Big%20Bang%20Theory.TiVo?Container=%2FNowPlaying&id=2338150 HTTP/1.1" 200 -
Decoding video
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 54014)
Traceback (most recent call last):
File "c:\python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "c:\python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "c:\python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "c:\python27\lib\SocketServer.py", line 638, in __init__
self.handle()
File "c:\python27\lib\BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "c:\python27\lib\BaseHTTPServer.py", line 328, in handle_one_request
method()
File "C:\Users\Scott\Desktop\TivoProxy\Tivo Proxy Server.py", line 160, in do_GET
decode = subprocess.Popen(['tivodecode', '-m', Tivo_MAK, '--', '-'],shell=False,bufsize=0,stdin=subprocess.PIPE,stdout=subproce ss.PIPE)
File "c:\python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "c:\python27\lib\subprocess.py", line 896, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
----------------------------------------
Allanon
01-17-2013, 04:25 PM
Bradleys, give this a try. It is a version of the program that includes tivodecode. Just copy the folder on to your desktop and run Tivo Server Proxy.bat as admin. If this doesn't work then I have no idea why it's failing on your computer. I've run this exact build on Windows 7 and it worked.
The tivodecode.exe included in this attachment is for Windows only.
bradleys
01-18-2013, 05:54 PM
I brought home my work laptop that is running Windows XP and did a fresh install on everything... This works perfectly.
I also installed it on my media server and it works great in that environment as well... But, just does not work on my Windows 7 desktop. Weird....
tatergator1
01-20-2013, 09:27 PM
I've also tried my hand at getting this setup. I've had partial success. It seems to be choking on something in my XML file. I've got TivoServer.py running fine and I am using the "podcast" method in VLC to serve the files. Using this method, it pulls in only the most recent 6 programs recorded. When I then attempt to play any of those files, it is unable to serve the first 5, which is probably a result of Time Warner's "copy once" CCI byte. The 6th program is from a local channel and is not affected by the CCI byte.
I know I'm probably out of luck regarding that, but the real question is what is causing the XML to cut-out after the first 6 most recent shows.
serving at port 8000
/rss
Desktop - - [20/Jan/2013 22:24:58] "GET /rss HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 59854)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 639, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 343, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 331, in handle_one_request
method()
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 130, in
do_GET
writeRSS(self.wfile)
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 96, in w
riteRSS
p.feed(XML.read(), wfile)
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 42, in f
eed
self._parser.Parse(data, 0)
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 64, in e
nd
self.wfile.write('\t\t<' + tag + '>' + self.data + '</' + tag + '>\n')
File "C:\Python27\lib\socket.py", line 316, in write
data = str(data) # XXX Should really reject non-string non-buffers
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 33:
ordinal not in range(128)
----------------------------------------
When I try to play the 6 videos, I get:
----------------------------------------
/download/Max%20%26%20Ruby.TiVo?Container=%2FNowPlaying&id=232446
Video URL: http://192.168.1.100:80/download/Max%20%26%20Ruby.TiVo?Container=%2FNowPlaying&id=232446
Desktop - - [20/Jan/2013 22:28:20] "GET /download/Max%20%26%20Ruby.TiVo?Container=%2FNowPlaying&id=2
32446 HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 59866)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 639, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 343, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 331, in handle_one_request
method()
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 153, in do_GET
videoFile = openUrl(link, 'tivo', Tivo_MAK)
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 24, in openUrl
return urllib2.urlopen(url)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 432, in error
result = self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1072, in http_error_401
host, req, headers)
File "C:\Python27\lib\urllib2.py", line 957, in http_error_auth_reqed
return self.retry_http_digest_auth(req, authreq)
File "C:\Python27\lib\urllib2.py", line 968, in retry_http_digest_auth
resp = self.parent.open(req, timeout=req.timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 438, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
----------------------------------------
/download/Mickey%20Mouse%20Clubhouse.TiVo?Container=%2FNowPlaying&id=232443
Video URL: http://192.168.1.100:80/download/Mickey%20Mouse%20Clubhouse.TiVo?Container=%2FNowPlaying
&id=232443
Desktop - - [20/Jan/2013 22:28:20] "GET /download/Mickey%20Mouse%20Clubhouse.TiVo?Container=%2FNowPl
aying&id=232443 HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 59871)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 639, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 343, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 331, in handle_one_request
method()
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 153, in do_GET
videoFile = openUrl(link, 'tivo', Tivo_MAK)
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 24, in openUrl
return urllib2.urlopen(url)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 432, in error
result = self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1072, in http_error_401
host, req, headers)
File "C:\Python27\lib\urllib2.py", line 957, in http_error_auth_reqed
return self.retry_http_digest_auth(req, authreq)
File "C:\Python27\lib\urllib2.py", line 968, in retry_http_digest_auth
resp = self.parent.open(req, timeout=req.timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 438, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
----------------------------------------
/download/Blue's%20Clues.TiVo?Container=%2FNowPlaying&id=232448
Video URL: http://192.168.1.100:80/download/Blue's%20Clues.TiVo?Container=%2FNowPlaying&id=232448
Desktop - - [20/Jan/2013 22:28:21] "GET /download/Blue's%20Clues.TiVo?Container=%2FNowPlaying&id=232
448 HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 59876)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 639, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 343, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 331, in handle_one_request
method()
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 153, in do_GET
videoFile = openUrl(link, 'tivo', Tivo_MAK)
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 24, in openUrl
return urllib2.urlopen(url)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 432, in error
result = self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1072, in http_error_401
host, req, headers)
File "C:\Python27\lib\urllib2.py", line 957, in http_error_auth_reqed
return self.retry_http_digest_auth(req, authreq)
File "C:\Python27\lib\urllib2.py", line 968, in retry_http_digest_auth
resp = self.parent.open(req, timeout=req.timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 438, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
----------------------------------------
/download/Hercules.TiVo?Container=%2FNowPlaying&id=234088
Video URL: http://192.168.1.100:80/download/Hercules.TiVo?Container=%2FNowPlaying&id=234088
Desktop - - [20/Jan/2013 22:28:21] "GET /download/Hercules.TiVo?Container=%2FNowPlaying&id=234088 HT
TP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 59881)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 639, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 343, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 331, in handle_one_request
method()
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 153, in do_GET
videoFile = openUrl(link, 'tivo', Tivo_MAK)
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 24, in openUrl
return urllib2.urlopen(url)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 432, in error
result = self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1072, in http_error_401
host, req, headers)
File "C:\Python27\lib\urllib2.py", line 957, in http_error_auth_reqed
return self.retry_http_digest_auth(req, authreq)
File "C:\Python27\lib\urllib2.py", line 968, in retry_http_digest_auth
resp = self.parent.open(req, timeout=req.timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 438, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
----------------------------------------
/download/Mickey%20Mouse%20Clubhouse.TiVo?Container=%2FNowPlaying&id=232231
Video URL: http://192.168.1.100:80/download/Mickey%20Mouse%20Clubhouse.TiVo?Container=%2FNowPlaying
&id=232231
Desktop - - [20/Jan/2013 22:28:22] "GET /download/Mickey%20Mouse%20Clubhouse.TiVo?Container=%2FNowPl
aying&id=232231 HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.6', 59886)
Traceback (most recent call last):
File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Python27\lib\SocketServer.py", line 639, in __init__
self.handle()
File "C:\Python27\lib\BaseHTTPServer.py", line 343, in handle
self.handle_one_request()
File "C:\Python27\lib\BaseHTTPServer.py", line 331, in handle_one_request
method()
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 153, in do_GET
videoFile = openUrl(link, 'tivo', Tivo_MAK)
File "C:\Users\Andrew\Desktop\Tivo Server\Tivo Proxy Server.py", line 24, in openUrl
return urllib2.urlopen(url)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 432, in error
result = self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1072, in http_error_401
host, req, headers)
File "C:\Python27\lib\urllib2.py", line 957, in http_error_auth_reqed
return self.retry_http_digest_auth(req, authreq)
File "C:\Python27\lib\urllib2.py", line 968, in retry_http_digest_auth
resp = self.parent.open(req, timeout=req.timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 438, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
----------------------------------------
/download/CBS%20Evening%20News%20With%20Scott%20Pelley.TiVo?Container= %2FNowPlaying&id=232019
Video URL: http://192.168.1.100:80/download/CBS%20Evening%20News%20With%20Scott%20Pelley.TiVo?Container= %2FNowPlaying&id=232019
Desktop - - [20/Jan/2013 22:28:22] "GET /download/CBS%20Evening%20News%20With%20Scott%20Pelley.TiVo?Container= %2FNowPlaying&id=232019 HTTP/1.1" 200 -
Decoding video
Encryption by QUALCOMM ;)
I'd appreciate any effort you might make to see what's going on. Also, If i try to load the RSS via Firefox, I get the following:
XML Parsing Error: no element found
Location: http://192.168.1.6:8000/rss
Line Number 45, Column 1:
Here's the accompanying XML file:
Thanks,
Allanon
01-21-2013, 12:18 AM
Tatergator1, the Tivo XML file had an episode title with unicode (Daisy, la Quinceañera). I fixed the program so it replaces the unicode with the equivalent ascii character. If there isn't one then a ? is put in place of the character.
Also, try running the program as administrator to get rid of the forbidden error.
Attached is the updated code:
tatergator1
01-21-2013, 12:09 PM
Thanks so much for the update. I really appreciate you taking the time to review my situation. My RSS feed has increased to 16 times and no errors are listed anywhere.
The question is, why isn't it parsing all 90+ items that I can see in my XML file?
As for the Forbidden 403's, I'm very confident those are related to the copy protection blocking transfers of those programs. I am currently running as admin, so that shouldn't be a problem. For example, with the larger RSS feed, I can play 3 of the 16 items, with the 3 items I can play being on CBS and PBS, which Time Warner Cable can't legally copy-protect.
Any thoughts on why I only get 16 of my 90+ items?
Allanon
01-21-2013, 01:19 PM
The question is, why isn't it parsing all 90+ items that I can see in my XML file?
Is this a different XML file than the one posted? The one posted only had 16 items.
tatergator1
01-21-2013, 07:47 PM
My mistake. There are only 16 items in the XML generated yesterday evening, What was throwing me off was the <Total Items> line that shows 98. I just reloaded the XML file off the Tivo Premiere and it's still only showing the most recent 16 Items, while <total items> is now 99.
Now the question is why is the Tivo generated XML file incomplete?
Update: I just loaded the XML off my old Series 2 DT for the first time as a test and the generated XML shows <total items> 58 and <item count> 58. Everything looks good from the Series 2. Now, why is the Premiere XML incomplete?
Another update:
Found this discussion here. (http://www.tivocommunity.com/tivo-vb/showthread.php?t=483077)
Looks like Premiere's have deliberately truncated XML's. I can get up to 50 items in the XML by adding &ItemCount=50 to the URL. I would then need to run another XML grab by using AnchorOffset=51&ItemCount=50. Makes things a bit more complicated.
Allanon
01-21-2013, 11:18 PM
Tatergator1, I will update the program to account for this. Guess I better start recording some shows so I can test. :)
Allanon
01-22-2013, 01:06 AM
Attached is an updated version of the code. This version will list all videos in the RSS feed, not just the first 16.
Tatergator1, thanks for discovering the bug and providing a link to a way to solve the problem. It made fixing the problem very easy.
tatergator1
01-22-2013, 12:36 PM
That did it! Thanks for taking the time to address my problems. This should be a good way to let my wife watch some of her shows in the Office/Craft Room without having to spend the 10+ minutes to download the whole .tivo file. This is a nice way to MRV without the Tivo. You give up trick-play capabilities, but you get near-instant playback straight from the host Tivo.
This will be a nice solution until Tivo finally releases more details and pricing on the Mini!
bradleys
01-22-2013, 01:50 PM
What we need now is a decent video server that can take a custom RSS feed and be served in the home (maybe externally). I have tried plugins for both plex and Windows Media server and haven't found anything that works perfectly yet.
Most of what I am looking at are designed around video podcasts...
Allanon
01-22-2013, 04:19 PM
What we need now is a decent video server that can take a custom RSS feed and be served in the home (maybe externally). I have tried plugins for both plex and Windows Media server and haven't found anything that works perfectly yet.
Most of what I am looking at are designed around video podcasts...
I got it to work with both Serviio Media Server (http://www.serviio.org/) and PS3 Media Server (http://www.ps3mediaserver.org/). I use these to stream to my Sony TV and Xbox 360.
bradleys
01-22-2013, 10:32 PM
I want to say that this new version has fixed all of my issues! The rss is properly formatted and I can play and stream video's.
Allanon, when you have a chance - can you take a quick screen print to show me how you have the rss feed configured on the Serviio counsole?
I am not seeing the feed and I am sure it is just me being dense.
Allanon
01-23-2013, 02:12 AM
Allanon, when you have a chance - can you take a quick screen print to show me how you have the rss feed configured on the Serviio counsole?
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=17971&stc=1&d=1358928791
1. Open the Serviio console
2. Click on "Library"
3. Click on "Online sources"
4. Click on "Add"
5. Enter RSS feed and name then click "Add"
6. Click on "Save"
Serviio should read the RSS feed and launch ffmpeg to check each video in the feed. You should probably turn on transcoding so the video is converted in to the proper format for your devices. It might take a while before the program actually reads the RSS feed. You won't be able to see the videos on your device until the RSS feed and ffmpeg process has been preformed.
bradleys
01-23-2013, 08:46 AM
OK, that is how I set it up - but I wasn't very patient! :)
I want to say again that this is now working perfectly. I am wondering if the number of shows on my TiVo was giving us an invalid xml file at the break. Anyway, thanks a lot for the work.
tatergator1
01-23-2013, 09:45 AM
Out of curiosity, using Serviio and serving to your Sony TV or Xbox, do you have FF/REW capabilities of the video?
Allanon
01-23-2013, 05:33 PM
Out of curiosity, using Serviio and serving to your Sony TV or Xbox, do you have FF/REW capabilities of the video?
No, FF/REW, just pause.
csell
01-24-2013, 09:19 AM
Quick question - I finally was able to get this working (for the most part). Anyway, is it true that this does not work on copyrighted video? It seems to not play any copyrighted material but will play all of the ones that are not. Is this true or am I missing something?
tatergator1
01-24-2013, 09:25 AM
Yes. It will not play anything that you would not be able to transfer to your computer. This is using the capabilities of the TIVO HME system. The only way to watch copy-protected videos is via true streaming between Tivo Premieres or in your home network with the Tivo Stream.
The set-up acts like a video "stream", but this is really just transferring and displaying the video on to non-Tivo peripherals, and transfers aren't permitted with copy-protected shows.
jlobello
01-24-2013, 10:59 AM
I found this thread & tried out the software last night. It seems to be working perfectly from VLC. I was able to have VLC view the RSS feed, then click on an entry & the video starts up right away! This seems like a great idea, rather than waiting for the whole video to transfer -- you can start viewing it right away. Trick play is obviously not working, as is to be expected.
I also tried viewing a show on my iphone. Mobile safari doesn't know how to deal with RSS feeds, so that didn't work. Instead I sent an e-mail to myself with the direct URL to a show. I was then able to use the app, oplayer lite, to view a show!! But, sound was not working, which I think is due to an oplayer bug.
csell
01-24-2013, 01:50 PM
I found this thread & tried out the software last night. It seems to be working perfectly from VLC. I was able to have VLC view the RSS feed, then click on an entry & the video starts up right away! This seems like a great idea, rather than waiting for the whole video to transfer -- you can start viewing it right away. Trick play is obviously not working, as is to be expected.
I also tried viewing a show on my iphone. Mobile safari doesn't know how to deal with RSS feeds, so that didn't work. Instead I sent an e-mail to myself with the direct URL to a show. I was then able to use the app, oplayer lite, to view a show!! But, sound was not working, which I think is due to an oplayer bug.
I just found it yesterday as well and spent a few hours to get it up and running. Very cool and great work was done on it. Unfortunately it seems like 80% of my shows are copyrighted and thus can't be transferred. So I probably won't spend anymore time on it cause of that fact. But again, great work by all involved.
tatergator1
01-24-2013, 02:19 PM
I just found it yesterday as well and spent a few hours to get it up and running. Very cool and great work was done on it. Unfortunately it seems like 80% of my shows are copyrighted and thus can't be transferred. So I probably won't spend anymore time on it cause of that fact. But again, great work by all involved.
Let me guess, Time Warner Cable? I feel you pain. Only broadcast stations (CBS, NBC, etc.) are viewable for me.
I think a lot of people would find this useful, but it's been flying under the radar for a while. I see two drawbacks to the method: copy-protection, and lack of FF/REW. Perhaps a solution to FF/REW could be developed, but copy-protection circumvention is a non-starter. Still, Allanon has developed a relatively easy to implement MRV method that doesn't require another Tivo box.
csell
01-24-2013, 03:19 PM
Still, Allanon has developed a relatively easy to implement MRV method that doesn't require another Tivo box.
Tell me more!
tatergator1
01-24-2013, 03:24 PM
I was speaking some what generally, but I believe he's had success using Serviio Media Server in conjunction with the python script. Serviio can deliver the video to a number of Smart TV's as well as PS3's, Xbox 360's, etc. See here: http://www.serviio.org/features.
There is some discussion of how to set that up within this thread as well.
csell
01-24-2013, 03:40 PM
I was speaking some what generally, but I believe he's had success using Serviio Media Server in conjunction with the python script. Serviio can deliver the video to a number of Smart TV's as well as PS3's, Xbox 360's, etc. See here: http://www.serviio.org/features.
There is some discussion of how to set that up within this thread as well.
But the copy protection issue still applies?
tatergator1
01-24-2013, 03:47 PM
But the copy protection issue still applies?
Yes, as I mentioned above, getting around the copy-protection is not possible. We just have to wait for the Tivo Mini (which will do true streaming) and hope the pricing is reasonable, or have multiple Premiere boxes to stream the copy-protected stuff.
Allanon
01-24-2013, 05:47 PM
I first developed this program so I could instantly watch TiVo videos on my Sony smart TV. I knew FF/REW and copy protected files was not going to be possible. But after thinking about the FF/REW problem there is probably a solution, it would require decoding the TiVo file to a file on disk then feeding that file to the media server. The downside is you will need a few GB of free space on your hard drive. I could probably add this feature as an option.
I also would like to add a HTML webpage that will have links to the videos. This will make it easier to play in a browser. And I've also thought about adding my own UPNP server which would eliminate the need for a separate media server. But these are just things I'd like to do and I'm making no promises on them ever being added.
If you have any ideas for this program please post them.
Also, I will probably start a new thread on this forum for this program. It will have a description and documentation as the first post and I can just keep updating that post with changes opposed to a new version in each post I make.
vanclute
01-26-2013, 03:39 AM
Been absent a bit and I see that much has happened with this! I can now see the entire Now Playing list. Unfortunately, playback still fails completely. :(
Video URL: http://192.168.2.10:80/download/The%20Asphalt%20Jungle.TiVo?Container=%2FNowPlaying&id=1336368
192.168.2.16 - - [26/Jan/2013 01:42:05] "GET /download/The%20Asphalt%20Jungle.TiVo?Container=%2FNowPlaying&id=1336368 HTTP/1.1" 200 -
Decoding video
----------------------------------------
Exception happened during processing of request from ('192.168.2.16', 50181)
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 "/Applications/Tivo Proxy Server 5.py", line 172, in do_GET
decode = subprocess.Popen(['tivodecode', '-n','-m', Tivo_MAK, '--', '-'],shell=False,bufsize=0,stdin=subprocess.PIPE,stdout=subproce ss.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
----------------------------------------
Any idea why?
Allanon
01-26-2013, 02:47 PM
Been absent a bit and I see that much has happened with this! I can now see the entire Now Playing list. Unfortunately, playback still fails completely. :(
Video URL: http://192.168.2.10:80/download/The%20Asphalt%20Jungle.TiVo?Container=%2FNowPlaying&id=1336368
192.168.2.16 - - [26/Jan/2013 01:42:05] "GET /download/The%20Asphalt%20Jungle.TiVo?Container=%2FNowPlaying&id=1336368 HTTP/1.1" 200 -
Decoding video
----------------------------------------
Exception happened during processing of request from ('192.168.2.16', 50181)
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 "/Applications/Tivo Proxy Server 5.py", line 172, in do_GET
decode = subprocess.Popen(['tivodecode', '-n','-m', Tivo_MAK, '--', '-'],shell=False,bufsize=0,stdin=subprocess.PIPE,stdout=subproce ss.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
----------------------------------------
Any idea why?
That error happens when tivodecode can't be found. Do you have tivodecode in the same directory as the program? Are you running the program directly out of the program's directory?
vanclute
01-26-2013, 09:04 PM
As a matter of fact I was not running it where tivodecode was, so thanks for pointing that out.
However, even when running it within the tivodecode directory, I get the identical error.
Allanon
01-26-2013, 11:48 PM
As a matter of fact I was not running it where tivodecode was, so thanks for pointing that out.
However, even when running it within the tivodecode directory, I get the identical error.
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:
http://<Server_IP>:<Port>/html
srauly
01-27-2013, 08:00 AM
If I get this working the next step is to try to feed this to my Plex Media Server using the feed me plugin. With that you can stream to Roku boxes, xbox... Heck, any number of devices.Please post back if you get this working with Plex.
vanclute
01-28-2013, 05:01 PM
No apparent change I don't think...
Video URL: http://192.168.2.10:80/download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPla ying&id=1338396
192.168.2.16 - - [28/Jan/2013 15:04:37] "GET /download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPla ying&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
----------------------------------------
vanclute
01-28-2013, 05:56 PM
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:
cmd = [os.path.join(os.getcwd(), 'tivodecode'), '-n','-m', Tivo_MAK, '--', '-']
to this:
cmd = [os.path.join(os.getcwd(), 'Desktop/tivodecode/tivodecode'), '-n','-m', Tivo_MAK, '--', '-']
and now I get this:
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=%2FNowPla ying&id=1338396
Video URL: http://192.168.2.10:80/download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPla ying&id=1338396
192.168.2.16 - - [28/Jan/2013 15:59:50] "GET /download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPla ying&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?
Allanon
01-28-2013, 10:11 PM
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:
cmd = [os.path.join(os.getcwd(), 'tivodecode'), '-n','-m', Tivo_MAK, '--', '-']
to this:
cmd = [os.path.join(os.getcwd(), 'Desktop/tivodecode/tivodecode'), '-n','-m', Tivo_MAK, '--', '-']
and now I get this:
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=%2FNowPla ying&id=1338396
Video URL: http://192.168.2.10:80/download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPla ying&id=1338396
192.168.2.16 - - [28/Jan/2013 15:59:50] "GET /download/Biggest%20Baddest%20Model%20Moments.TiVo?Container=%2FNowPla ying&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?
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.
vanclute
01-29-2013, 01:13 AM
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:
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?
Allanon
01-29-2013, 01:59 PM
Vanclute, attached is an update that should fix the tivodecode path problem and hopefully fix the latest error you are getting.
vanclute
01-29-2013, 06:37 PM
sigh... afraid not:
/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.
vanclute
01-29-2013, 06:40 PM
oops nevermind this... last post still accurate.
Allanon
01-29-2013, 10:34 PM
Vanclute, remove the # character from these three lines of code at the bottom of the code then try running:
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.
vanclute
01-29-2013, 11:23 PM
Uncommenting those lines and running the script, I get:
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?
Allanon
01-30-2013, 01:32 AM
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.
vanclute
01-30-2013, 11:07 AM
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?
Allanon
01-30-2013, 02:17 PM
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.
wmcbrine
01-31-2013, 02:11 AM
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.
vanclute
01-31-2013, 04:25 PM
Alas wmcbrine appears to be correct, no change with the latest version.
vanclute
02-05-2013, 07:45 PM
So are we at a dead on with this on Mac? :( I was so hopeful...
Allanon
02-05-2013, 10:28 PM
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.
bradleys
02-13-2013, 11:25 PM
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.
http://www.tivocommunity.com/tivo-vb/attachment.php?attachmentid=18213&d=1360820054
But it was nice getting it to this point.
vanclute
02-21-2013, 02:49 PM
That's great... now if only the videos would play for me in the first place. :(
bradleys
02-21-2013, 06:04 PM
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.
Allanon
02-28-2013, 02:36 PM
Here is an update that fixes file transfers. The problem is detailed in this thread:
http://www.tivocommunity.com/tivo-vb/showthread.php?t=501420.
This version added a cookie with sid='ABC'.
mulscully
02-28-2013, 07:53 PM
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)
http://www.mediawebsite.com/stuff/error1.jpg
Allanon
03-01-2013, 12:23 AM
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.
mulscully
03-01-2013, 09:58 AM
Thanks, I will give this a try sometime tonight or tomorrow and post the result....
mulscully
03-03-2013, 07:21 PM
Nah... still getting the same error... Believe its a win 7 issue....
vanclute
03-10-2013, 09:09 PM
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:
/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
----------------------------------------
Allanon
03-11-2013, 02:24 AM
Vanclute, for some reason the last version didn't have the code that fixed your path problem. This version should work.
vanclute
03-29-2013, 12:09 AM
Unfortunately, no go here either.
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
----------------------------------------
vBulletin® v3.6.8, Copyright ©2000-2013, Jelsoft Enterprises Ltd.