TivoGrab


A while back I mentioned a little work I was doing investigating getting my recorded shows off of my new Tivo onto more portable media (I watch my shows on the train to work).

After talking about that, my friend Allan spoke with me about getting a script together and specifically, about getting a BashPodder type of setup working to download the shows automatically. Well, I did a little poking around with php and after some tweaking I have some up with just such a monster. Now Allan was supposed to beta the script out for me this weekend, and I haven’t heard anything from him yet, however, I have been running the script myself now for most of a week and have decided to release it into the wild after commenting the crap out of the code. So without further ado, I give you TivoGrab.

Now just for a little review: This php script is designed, similarly to BashPodder, to be run from command line, probably via crontab entry. I have designed and tested the script on php 5.x cli with simplexml, which I believe to be included standard with php 5. In a nutshell, this script downloads the shows.xml file from a web enabled tivo2 (and maybe others?), parses it out for downloadable shows, checks those shows against a log file it keeps of downloaded shows, and creates a bash script from the results. The bash script, called getshows.sh, will download the shows off the tivo, decode them, and convert them for further use.

Now this leaves a variety of ways open for this to be run, but probably the most popular would be by hand and through a crontab entry. By hand, you can run the php file “php tivograb.php”, generate the getshows.sh and then have the opportunity to look through it and delete any shows you really don’t want before running the shell script (it’s not hard to follow). As a crontab entry I would recommend running it out of a wraper shell script so you can launch the tivograb.php and then the getshows.sh afterwards. One small warning about that, though, would be to keep good track of that process as it can take a very long time to run – maybe once a day during the night would be a good time.

As always, I am interested in seeing what else people can do with this, so drop me a note and let me know!

Leave a Reply

You must be logged in to post a comment.