# A better /nowplaying/index.html



## gman622

this file is an alternative to the generic 'now playing' webpage located on your tivo's webserver.
kinda nice to have if your pc's next to your tv.
it'll show you: total time, total space used, time left, expiration date, recording quality, plus various details about the program that are recorded.

to use 
1. copy and paste into your favorite editor this xhtml code: http://my.opera.com/gman622/blog/show.dml/315486
++++save it as *nowplaying.xhtml*

2.-change line 9 to enter your tivo's location and IP (and storage space if you want) 
-change line 14 to reflect your Media Access Key
-you can add more tivo's by uncommenting lines 10-13
***IMPORTANT: when you save the edited file the extension *must* be .xhtml

4. open in *Firefox* browser (Opera doesn't work)


----------



## gonzotek

Nice! That's a _slick_ ajax script.


----------



## redrhino

Nice ...

So, what is the most precise way to determine total disk space minus OS?


Code:


var totalGB = 29.252; //(optional) total gigabytes used to record shows

 29.252 seems so precise you must have good reason.

Redrhino


----------



## Globular

I like it! But, where is the link to download the .TiVo file?

I will play with it.

-Matt


----------



## gman622

redrhino said:


> 29.252 seems so precise you must have good reason.


all i did was fill up my tivo, start recording in five minutes increments until it deleted one of the five minute recordings; and then added up all the source sizes.


----------



## redrhino

What is the size of the TiVo OS?

I figure that one could take the size of disk - size of OS to get the number you need...

I guess that one could also always add up all the sizes of shows in "now playing" via the web interface and ballpark it.

Redrhino


----------



## tivoking

GMAN you rock!!!


----------



## Paulson

It's cool but no place to link to tivo files...

sucks!


----------



## peteypete

Man, this rocks.

Thanks!!


----------



## cbordman

why not work with IE?


----------



## gman622

Paulson said:


> It's cool but no place to link to tivo files...
> 
> sucks!


hopefully it doesn't suck as much now...the download link is the MB size.

i also added links for every name that's listed in the details to their respective 
imdb page.


----------



## brichter

gman622 said:


> this file is an alternative to the generic 'now playing' webpage located on your tivo's webserver.
> kinda nice to have if your pc's next to your tv.
> it'll show you: total time, total space used, time left, recording quality, plus various details about the program that are recorded.
> 
> see a screenshot here:
> http://home.ripway.com/2005-2/266393/npx.png
> 
> to use
> 1. save this link on your machine:
> http://home.ripway.com/2005-2/266393/nowPlaying.xhtml


That needs to be saved on the Tivo, correct? 
Any idea how to do that on a Toshiba Series 2 with DVD player built in?


----------



## windracer

brichter said:


> That needs to be saved on the Tivo, correct?
> Any idea how to do that on a Toshiba Series 2 with DVD player built in?


No, you put this on your web server or run it through your browser on your PC. It will then connect to the specified TiVos and pull the information.


----------



## kcarl75

Thank you for the cool file. 

I have a 90 hour tivo, and usually record everything in basic.

what should i put in this section?

var totalGB = 29.252; //(optional) total gigabytes used to record shows


Thanks again.


----------



## windracer

windracer said:


> No, you put this on your web server or run it through your browser on your PC. It will then connect to the specified TiVos and pull the information.


Actually, I take some of that back. It works fine through Firefox when the file is local on my PC. When I tried to serve it through Apache (via my Linux web server) to Firefox, it didn't work. Guess it's not meant to work that way. 

Pretty cool looking though!


----------



## boscodegama

windracer said:


> Actually, I take some of that back. It works fine through Firefox when the file is local on my PC. When I tried to serve it through Apache (via my Linux web server) to Firefox, it didn't work. Guess it's not meant to work that way.
> 
> Pretty cool looking though!


Nope it's not. If you look at it and know anything about javascript you'll quickly realize it's all client side meaning the machine that it's actually executing on needs to be able to reach your TiVo(s) through the network.

Of course, there's little to keep you from having a go-between where your webserver makes the exact same requests of the TiVo that the file does and the file in turn makes the request of your webserver. Like a pipe sort of.

At any rate, was just adding some details for anyone that cared about all that stuff..


----------



## ElPuerco

Very nice... I wish the external links (to IMDB) opened in a seperate window. Guess if I wasn't so darned lazy I would fix it myself, though. 

Very good work!


----------



## gman622

ElPuerco said:


> I wish the external links (to IMDB) opened in a seperate window.


i have my preferences set in firefox for middle-clicked links to open in a background tab, or you can always right click->open in new tab/window.

personally i think's its rude when a webmaster doesn't leave the choice up to the user where he/she wants to open links.


----------



## grapeape

gman622 said:


> hopefully it doesn't suck as much now...the download link is the MB size.
> 
> i also added links for every name that's listed in the details to their respective
> imdb page.
> 
> http://home.ripway.com/2005-2/266393/nowPlaying.xhtml


When I click on the size, it prompts me for a username and password. Is there a default?


----------



## windracer

grapeape said:


> When I click on the size, it prompts me for a username and password. Is there a default?


Use 'tivo' as the username and your MAK as the password.


----------



## Kriston

Just wanted to let you know.

It does NOT work in konqueror.

Loaded FireFox and it worked fine.

Would NEVER try Internet Extorter, so I would not know about it.


----------



## AnteL0pe

Kriston said:


> Just wanted to let you know.
> 
> It does NOT work in konqueror.


Thats odd, it works fine in Safari.


----------



## Kriston

It is odd. I guess that it might be some of the new security features. When (if) I get some time I will dig a little deeper into it. I am running SuSE 9.2 on AMD 64 Athlon 3000+. It might be a 64 bit issue.


----------



## AnteL0pe

I'll try it from a linux box as well...


----------



## jhhyde

When I tried this in Firefox nothing happened.

The JavaScript Console says line 7 has a syntax error.

That would be the line that has this:

<![CDATA[

I'm not a Java guy, can anyone tell me what is going on, I just downloaded this and made my tivo ip and mak changes. I also downloaded another copy just to make sure I didn't change line 7.


----------



## Kriston

I just tried the 32 bit version (on a different computer). Same thing. I get the skeleton of the format, but no data is filled in. Mozilla and FireFox both work properly.

Konqueror never displays certificate or cookie info dialog like the others. It may be rejecting something before I see it.


----------



## Kriston

I just enabled javascript debug and error checking. I gate a Parse Error at line 8.
This is the line that sets the tivo_ip variable.

Still investigating.


----------



## morac

This is very cool, but it suffers from the same bug that every other program that grabs all the shows at once from a TiVo does.

The TiVo will only return a maximum of 128 shows at one time. This means that your script will only show a maximum of (that's right) 128 shows. My TiVo contains 202 shows so the last 74 aren't picked up.

A simple fix for this is to grab a lower number of shows at once using the "AnchorOffset" and "ItemCount" parameters. For example by adding the following to the end of the URL it will grab 50 shows starting at index 100: "&ItemCount=50&AnchorOffest=100". If the number of shows left is less that the amount listed in ItemCount, than only the number of shows left will be returned. If the AnchorOffset is greater than the total number of shows, than no shows will be returned (the ItemCount XML variable will be 0).

I'm not sure exactly how this could be done easily in your code since it requires making multiple requests to the TiVo and parsing out the data for each request and your code doesn't look like it was designed to do this.


Also you do a blocking call which means the browser can't be used while the show listing is being downloaded. I once wrote a script to parse through a number of web pages using XMLHttpRequest and there is a way to write it so it does so in the background. Set the third parameter in the open() call to true and use the "onreadystatechange" variable to have it call a function when the server response comes in.


----------



## gman622

I've updated this so that the shows are now sortable. 
By clicking on the table header titles you can sort by:
SourceStation, Title, CaptureDate, SourceSize, and Recording Quality.

You can still get it at:
http://home.ripway.com/2005-2/266393/nowPlaying.xhtml

*still only guaranteed to work with FireFox


----------



## jhhyde

All fine and very good, but can anyone explain why I get syntax error on line 7 when I try it in Firefox?

That would be the line that has this:

<![CDATA[

So far, the Firefox guarantee is not valid.


----------



## morac

You should be able to use Sarissa to make it compatible with Internet Explorer. Sarissa is a bunch of javascripts that emulate Mozilla's XSLT functions for IE.


----------



## GCymbala

Hope you don't mind ... I made some changes to a copy of your "better now playing list" for my own needs. I've got two TiVos, and I didn't want to maintain two copies of the file, so I added a with the my list of TiVos. Also removed some spaces between the quotes around EpisodeTitles -- they just bugged me. I also defaulted to sorting by Title, by adding


Code:


<xsl:sort select="t:Details/t:Title"/>

 to the for-each Item loop.

You can see it at: cymbala[dot]com/Greg/nowPlaying.zip

I appreciate the work you've put into this -- would have taken me too long to ever get around to doing it myself

-Greg



gman622 said:


> I've updated this so that the shows are now sortable.
> By clicking on the table header titles you can sort by:
> SourceStation, Title, CaptureDate, SourceSize, and Recording Quality.
> 
> *still only guaranteed to work with FireFox


----------



## gman622

GCymbala said:


> I made some changes to a copy of your "better now playing list" for my own needs.


I don't mind at all; sorry to inflict my code upon you. This was my first foray into xsl (and CSS and Javascript and XHTML for that matter) and it definitely turned into "the 'hack-iest' thing that could possibly work."



GCymbala said:


> a with the my list of TiVos.


that a good idea; although it might be better for me to generalize it (maybe an array of IP's) so that any number of tivo's will work.



GCymbala said:


> I also defaulted to sorting by Title, by adding
> 
> 
> Code:
> 
> 
> <xsl:sort select="t:Details/t:Title"/>
> 
> to the for-each Item loop.


that brings up a bug that I should fix, currently when you sort by title it doesn't take into account ones that start with "The" or "A" (are there others that i'm forgetting?). I don't think that can work with xsl:sort but it's an easy fix in the sortTable function.

There's also a couple of enhancements I was thinking of making including a SVG Pie Chart and making it possible to sort by Expiration Date. If anyone has any suggestions feel free to chime in.

One problem I am having is trying to make an async xml request. It seems to retrieve the xml document ok but choke with an uncaught exception when I try to transform it. If anyone can help:


Code:


        var xsltProcessor = new XSLTProcessor();
        var xmlDoc;
        xsltProcessor.importStylesheet(xsltSheet);
        var myXMLHTTPRequest = new XMLHttpRequest();
        netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
        myXMLHTTPRequest.open("GET", 'np.xml', true,'tivo',mak);

        myXMLHTTPRequest.onreadystatechange=function() {
            if (myXMLHTTPRequest.readyState==4) {
                xmlDoc = myXMLHTTPRequest.responseXML;
           }
        }

        myXMLHTTPRequest.send(null);
        var fragment = xsltProcessor.transformToFragment(xmlDoc, document);


----------



## GCymbala

Sheesh! Hold on ... one more post and maybe I'll stop getting all these stupid "Your Post contains one or more URL..." messages...


----------



## GCymbala

gman622 said:


> that a good idea; although it might be better for me to generalize it (maybe an array of IP's) so that any number of tivo's will work.


Yep, I was thinking the same thing, but being lazy, couldn't be bothered to write a function to create the list dynamically from an array. Plus, I wanted to use their names, not just IP addresses, so it'd have to be a 2-dimensional array, which is a little ugly in JavaScript.



gman622 said:


> that brings up a bug that I should fix, currently when you sort by title it doesn't take into account ones that start with "The" or "A" (are there others that i'm forgetting?). I don't think that can work with xsl:sort but it's an easy fix in the sortTable function.


I realized this too, but it didn't bother me too much.



gman622 said:


> There's also a couple of enhancements I was thinking of making including a SVG Pie Chart and making it possible to sort by Expiration Date. If anyone has any suggestions feel free to chime in.


Sounds cool. The only SVG I've ever touched, though was inside Paint Shop Pro, and glancing at the source once or twice.



gman622 said:


> One problem I am having is trying to make an async xml request. It seems to retrieve the xml document ok but choke with an uncaught exception when I try to transform it. If anyone can help:


I tried to get this working, but had trouble too. I ended up making the myXMLHTTPRequest in global scope. That seemed to solve something, but created others because the code continued to try to parse the response after the send. I ended up having to move a bunch of code into the onreadystate function, since that's where you need to fire things from.

At the top, right after 


Code:


var totalGB = 29.252;

I've got:



Code:


var xsltSheet = document.getElementsByTagNameNS('[XSL Namespace]', 'stylesheet')[1];
var myXMLHTTPRequest = new XMLHttpRequest();

function CheckXMLHTTPReadyState() {
	if (myXMLHTTPRequest.readyState==4) {

		netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
		var xsltNS = '[XSL Namespace]';
		var xsltSheet = document.getElementsByTagNameNS(xsltNS, 'stylesheet')[0];

		var xsltProcessor = new XSLTProcessor();
		xsltProcessor.importStylesheet(xsltSheet);
		var xmlDoc;
		xmlDoc = myXMLHTTPRequest.responseXML;
		var fragment = xsltProcessor.transformToFragment(xmlDoc, document);
		document.getElementById("divContent").appendChild(fragment);
		convertDates();
		calcTimeLeft();
	}
}

And in the *appendTransformation* I've got this:



Code:


netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
		myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.onreadystatechange=CheckXMLHTTPReadyState;
        
		myXMLHTTPRequest.open("GET", '[now playing url]', true,'tivo',mak);
        

		myXMLHTTPRequest.send(null);

I don't know if I need all those enablePrivilege's, but I'm not familiar with what they do and it didn't work unless I put 'em in there.


----------



## morac

I was getting the same error with my version. Based on your code I put the following line in my reponse handling routine and all the sudden it worked. 


> netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');


I was under the wrong impression that you only need to enable UniversalBrowserRead once per page, but according to the documentation, you need to call it per function.

Anyway, the code I have is a bit more simplistic (it only uses one global variable). I broke out the sending and handling of the request because I want to be able to send multiple requests to the TiVo in case it doesn't download all the listings on the first request. I also threw in some try, catch code to give the user some feedback in case of error. In addition I put a check in to see if the page returned from the TiVo is valid before trying to parse it.



Code:


var myXMLHTTPRequest;

function sendRequest() {
    try {
       myXMLHTTPRequest = new XMLHttpRequest();
       netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
       myXMLHTTPRequest.onreadystatechange = handleResponse;
       myXMLHTTPRequest.open("GET", 'https://'+tivo_ip+
              '/TiVoConnect?Command=QueryContainer&Container=%2FNowPlaying&Recurse=Yes'
              , true,'tivo',mak);
       myXMLHTTPRequest.send(null);
    }
    catch (e) { 
       alert("Error occurred sending request: " + e);
    }
}

function handleResponse()
{
    try {
      // if finished fetching page and no errors occurred
      if ((myXMLHTTPRequest.readyState == 4) && 
          (myXMLHTTPRequest.status < 300) && 
          (myXMLHTTPRequest.responseText!="")) {
         netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
         var xsltNS = 'http://www.w3.org/1999/XSL/Transform';
         var xsltSheet = document.getElementsByTagNameNS(xsltNS, 'stylesheet')[0];
         appendTransformation(xsltSheet);
         convertDates();
         calcTimeLeft();
      }
    }
    catch (e) { 
       alert("Error occurred handling response: " + e);
    }
}

function appendTransformation (xsltSheet) {
    var divContent = document.getElementById("divContent");
    var oForm = document.getElementById("frmSelTiVo");
    while (divContent.hasChildNodes())
	{
		divContent.removeChild(divContent.childNodes[0]);
	}
    if (typeof XSLTProcessor != 'undefined') {
        var xsltProcessor = new XSLTProcessor();
        xsltProcessor.importStylesheet(xsltSheet);
        var xmlDoc = myXMLHTTPRequest.responseXML;
        var fragment = xsltProcessor.transformToFragment(xmlDoc, document);
        document.getElementById("divContent").appendChild(fragment);
    }
}

window.onload = initPage;
function initPage()
{
	var tivo_list = document.getElementById("selTiVos");
	tivo_ip = tivo_list.options[tivo_list.selectedIndex].value;
	sendRequest();
}


----------



## morac

I threw something together which will download all the shows on the TiVo with multiple requests. Unfortunately there are a number of bugs that don't look very easy to fix, but perhaps someone familiar with XSLT might be able to.

Depending on how I coded either:

1. All the shows are broken out into multiple tables (one for each tivo request)

Or all the shows are shown in the same table, but:

1. The Now Playing header at the top lists the the wrong info data (only shows as of the first request)
2. If a suggestion is being recorded the table gets screwed up
3. Suggestions aren't put into the tab correctly.

I want to try to download all the data and combine it into one big XML file before it is translated, but I don't know if that is possible and since each table will contain the TiVo Detail tag I'm not sure it will work anyway.

If you want to see the code as it is currently (the part that makes multiple request), you can grab it at:

*removed - see post below for final version*

The zip file contains each method.


----------



## morac

Okay, I got it working. You can grab it from:

http://anonymous123.home.comcast.net/nowPlaying.xhtml

Just change the MAK and IP and you're all set.

There is an option to change how many shows will be grabbed per request. The lower the number the less shows grabbed at once, but the more often the page is updated. The higher the number the less often the page is updated. The total amount of time it takes shouldn't differ that much whatever the number is.

*Edit:* I made one minor update because the code I had was filling in the combined XML table from the last show to the first. Now the XML table will be filled in order.

By the way, even though I did not do so, it might be a good idea to remove the automatic title sorting that was added with the line


Code:


<xsl:sort select="t:Details/t:Title"/>

 (delete the line) because it slows down the rebuilding of the list as each new response comes in.


----------



## gman622

another update.....

1. another (sortable) column was added: Expires. now you can see which show will be deleted first, second, third and so on. (finally a use for the keep until date!)

2. multiple tivos are supported (though i'm not sure how well... i only have one)

3. requests are asynchronous, so the browser will not hang on lengthy GETs
(the tab/title will let you know when it's done loading)

4. now recording info will tell you if it's a planned or suggested recording.

here 'tis:
http://home.ripway.com/2005-2/266393/nowPlaying.xhtml


----------



## smithrl

jhhyde said:


> All fine and very good, but can anyone explain why I get syntax error on line 7 when I try it in Firefox?
> 
> That would be the line that has this:
> 
> <![CDATA[
> 
> So far, the Firefox guarantee is not valid.


I get the exact same error with Firefox - both with the original script and with Morac's version


----------



## gman622

smithrl said:


> I get the exact same error with Firefox - both with the original script and with Morac's version


 the file extension *must* be .XHTML

if you save the file in IE or notepad, it will change it on you.


----------



## gonzotek

gman622 said:


> another update.....
> 
> 1. another (sortable) column was added: Expires. now you can see which show will be deleted first, second, third and so on. (finally a use for the keep until date!)
> 
> 2. multiple tivos are supported (though i'm not sure how well... i only have one)
> 
> 3. requests are asynchronous, so the browser will not hang on lengthy GETs
> (the tab/title will let you know when it's done loading)
> 
> 4. now recording info will tell you if it's a planned or suggested recording.
> 
> here 'tis:
> http://home.ripway.com/2005-2/266393/nowPlaying.xhtml


Just keeps getting better 

*/edit: See gman's post above directly above this one, we were both replying at the same time, and I'll bet he has the better answer.*
To the users with the cdata error: Are you using any extensions that might cause a conflict? Are you using the most recent released version of Firefox(1.0.2 as of today)? If not, what version are you using? You could perhaps try creating a clean profile in Firefox.


----------



## morac

gman622 said:


> another update.....
> 
> 1. another (sortable) column was added: Expires. now you can see which show will be deleted first, second, third and so on. (finally a use for the keep until date!)


The page never finished loading when I tried it. It downloaded a number of the expiration information and then started generating javascript errors. I got about 50 of the following error:


> Error: zuluTime has no properties
> Source File: file:///d:/TiVo/nowPlaying.xhtml
> Line: 99


If I lower the amount of shows downloaded to around 5 than I don't get errors. I checked the .status field of the returns and the ones that get errors have a status of 503 (which is gateway timeout). If I had to guess I would say that the TiVo can't handle that many requests at once. It seems to max out at around 9 connections at once.

Instead of sending all the requests at once, you should probably pace the requests and send around 5 at once to start. Then as each request comes in you can send out another request.

I couldn't figure out how to easily send out 5 requests at once without losing count (a global variable could be used), but the following will send out 1 at a time which seems to work rather well:

In getContent around line 77 change


Code:


            for (i = 0; i < tblNP.rows.length; i++) {
                getExpDate(tivo_ip, tblNP.rows[i].cells[2], i, tblNP.rows.length-1);
            }

 to


Code:


 getExpDate(tivo_ip, 0, tblNP.rows.length-1);

Then change getExpDate call to take 3 parameters


Code:


function getExpDate(tivo_ip, node, timesCalled, timesToBeCalled){
    var showId = node.childNodes[0].childNodes[0].nodeValue;

 to


Code:


function getExpDate(tivo_ip, timesCalled, timesToBeCalled){
    var tblNP = document.getElementById('nowPlay');
    var node = tblNP.rows[timesCalled].cells[2];
    var showId = node.childNodes[0].childNodes[0].nodeValue;

 and finally add and else clause to the if (timesCalled==timesToBeCalled) statement at the bottom of getExpDate


Code:


            else {
                    getExpDate(tivo_ip, timesCalled + 1, timesToBeCalled)
            }


----------



## morac

I updated my version with the latest changes from gman662 or more precisely I incorporated my changes into his new code. I also put my fix above into the code. If you have less than 128 shows on your TiVo then you won't get any benefits from this version (unless you are experiencing the zulutime has no properties error which this fixes).

Just a note, I defaulted to download 10 shows at a time because I added code to update the title page as the shows are downloaded for indication purposes. Feel free to change the value or remove it and it will try to download all the listings at once (or as many as the TiVo will respond with at once which is 128).


----------



## gman622

morac said:


> status of 503 (which is gateway timeout). If I had to guess I would say that the TiVo can't handle that many requests at once. It seems to max out at around 9 connections at once.


hmm, it's been working fine all day for me. i've got 14 shows right now, maybe the max number of requests is 16? would the server be set to only handle that many though? its not a browser setting issue is it?



morac said:


> but the following will send out 1 at a time which seems to work rather well:


you're code works ok, except if you sort the columns while the expiration dates are loading then it screws up. it needs a handle to the node for each request. i think it's maybe the better way to do it though.

i'm curious if anyone else is getting these errors, and how many shows(requests) their tivos can handle.


----------



## smithrl

gman622 said:


> the file extension *must* be .XHTML
> 
> if you save the file in IE or notepad, it will change it on you.


Thanks!

That was exactly it. I didn't catch that Wordpad had changed the extension.

Great app!


----------



## morac

gman622 said:


> i'm curious if anyone else is getting these errors, and how many shows(requests) their tivos can handle.


I figured out the problem. Firefox defaults to only allow 2 open connections per server. This is controlled via the configuration "network.http.max-persistent-connections-per-server" which can be changed by typing "about:config" into the location bar in Firefox.
Many people, including myself bump this value up to a higher number in order to increase download performance (it's in most tweak guides). I use 8. So while 2 connections works with the TiVo, 8 apparently does not. I've tested and anything greater than 4 causes problems.

In any case by default Firefox will only allow 2 open TiVo connections at once so it basically acts like my code except two requests are sent at the same time instead of only one. So it will work as long as the user didn't increase "network.http.max-persistent-connections-per-server" to greater than 4.


----------



## morac

I figured out a way to keep from screwing up the tables when sorting.

I created an array of all the nodes and passed that to getExpDate. It might be better to pass an array of the tr's node ids and then get the cell's node from the id in getExpDate. This might save on memory depending on how pointer to nodes are stored.

In any case this is what I came up with:


Code:


                var nodes = new Array(tblNP.rows.length);
                for (i = 0; i < tblNP.rows.length; i++) {
                    nodes[i] = tblNP.rows[i].cells[2];
                }
                getExpDate(tivo_ip, nodes, 0, tblNP.rows.length-1);
.
.
.

function getExpDate(tivo_ip, nodes, timesCalled, timesToBeCalled){
    var node = nodes[timesCalled];
.
.
.
            else {
                    getExpDate(tivo_ip, nodes, timesCalled + 1, timesToBeCalled)
            }

I update my code with these changes so sorting won't mess up grabing the expiration date. Once again this is only useful for people who either have more than 128 shows or increased their "network.http.max-persistent-connections-per-server" value to a number greater than 4.


----------



## gman622

A small update and limitation workaround.
I added some detail to what's now recording (quality, expiration date, and partial recording time.)
I also fixed an error whereby any bad requests that are made are simply resubmitted- not a great fix but...(shrug). And still I get strange behavior if pipelining is enabled. It seems the TiVo's little webserver is easily overwhelmed. I'm curious what server is in there - probably a small custom one they wrote themselves?

Anyway: nowPlaying.xhtml


----------



## morac

Did you upload the new version? I'm still getting the old version from the link.


----------



## gman622

oops you're right sorry. it's there(here ) now.

the weird pipelining issue seems to only occur when the network.http.max-persistent-connections-per-server is less than 5, it doesn't break but it timeouts for a while. i'm not sure what it's doing.


----------



## morac

Well this version does eventually download all the expires info, but it takes a while. Also the way it is coded, it will just keep hammering the TiVo's web server until the response comes back. I don't know how well TiVo can handle something like that. I don't think the TiVo was really designed to handle multiple requests at once especially since it seems to take a second or two to process each request.

I still think a better way of doing this would be to limit the amount of actual request that the code makes to one or two at a time. That way it will work no matter how the user set up Firefox. I do use pipelining, though my per server setting is set to 8.

I took your code, and added the code to make multiple requests like I normally do. This time though, instead of sending out one request at a time for the expires info, I changed the code to send out 2 requests at a time. It seems to work very well. I had to revert some of your code from getExpDate to do so though. I did leave in the code to retry on failure though.

You can check it out here.


----------



## gman622

morac said:


> Well this version does eventually download all the expires info, but it takes a while.


the time difference seemed negligible to me - of course i only ever have 15-20 shows at any one time.

the only reason i added the expires column was to see which show would be deleted first,second and so on. as someone with only a 40gb tivo, i like to know the order of deletion for recordings (even this is problematic though, you can't change an expiration date to a date before today. so if you want something recorded today to be deleted before a bunch of shows recorded previously you have to change all the expiration dates)

for someone with a huge drive and huge number of show who doesn't ever worry about deletions, i think it best just to leave out that column. it would speed up the page load and you could still get the exp info with the show details link.


----------



## JerkyChew

This is neat. One question - it looks like the Tivo size variable is global? Is there a way to make it different for each tivo? My Tivo is an 80 hour, but the roommate's is only a 40 hour.


----------



## morac

Shoud be trivial to make it into an array just like the TiVo_ip variable.


----------



## TheCat

I'm using Firefox on Linux (Fedora Core 3). When I load the .xhtml file, I get two warnings about unsafe scripts. If I accept both, the page title changes to "Loading..." and the status bar says "none." Nothing else happens. Any suggestions?

p.s. I'm using morac's version, since gman622's links to a "file not found" error.


----------



## mkop

gman622 said:


> the file extension *must* be .XHTML
> 
> if you save the file in IE or notepad, it will change it on you.


I can not get it to load for anything, I have made sure the extension is correct, just comes up with a blank screen in firefox and does nothing. Any other suggestions?


----------



## morac

TheCat said:


> I'm using Firefox on Linux (Fedora Core 3). When I load the .xhtml file, I get two warnings about unsafe scripts. If I accept both, the page title changes to "Loading..." and the status bar says "none." Nothing else happens. Any suggestions?
> 
> p.s. I'm using morac's version, since gman622's links to a "file not found" error.


You should get a number of warnings, unless you select the remember option (which is dangerous do to a bug in Firefox). Check the javascript console for errors.

On a completely different topic I see this thread got Slashdotted.


----------



## rog

morac said:


> On a completely different topic I see this thread got Slashdotted.


Dude. You should be worried. They posted a link to your Comcast http server in the comments there.


----------



## morac

rog said:


> Dude. You should be worried. They posted a link to your Comcast http server in the comments there.


Yeah I noticed. I got an excited and  feeling at the same time. 

Fortunately the file is small, Comcast doesn't seem to have any bandwidth restrictions and, most importantly, a smaller than normal number of people read and commented on the story (probably because it was posted on Sunday).

I have a feeling though that most people who read Slashdot build their own DVRs instead of buying TiVos in which case the file is useless to them. Though there have been a fair number of TiVo posts on Slashdot recently.


----------



## Unix_Beard

Is this file gone? I get "Specified File Cannot be Found."


----------



## gman622

You should be able to download the file now. I use a free file hosting site that only allow 10MB of tranfers per 24hr. Needless to say it was all used up around 7:30 last night. If you still can't get it just message me your email, and i'll send the file to you.

nowPlaying.xhtml


----------



## Unix_Beard

Thanks gman622.


----------



## boscodegama

I would be happy to host this on my server, in addition, I made a small change to allow each Tivo the ability to have it's own TotalGB variable so that people with multiple tivos of different sizes can make use of that. What do you think?


cheers...


----------



## Maui

I agree - Just downloaded this and it is great!


----------



## windracer

djithm said:


> *whats a MAK??*


*M*edia *A*ccess *K*ey. This is the long number you had to put into TiVoDesktop to transfer shows. You can find it under My Account on tivo.com, or on your DVR under System Information.


----------



## doormat

Am I the only one who for this isnt working? I added my IP for my Tivo and my MAK and yet nothing really (I get a page with formatting and some text, but no real data).


----------



## jhhyde

Make sure the extension on your modified and saved version is XHTML. Often times the text editor you use will change it to TXT.


----------



## doormat

Yea its xhtml. So should I have it local or on my webserver?


----------



## morac

It should be local for a number of reasons:

1. It has your MAK in it and you don't want others to get that
2. People on the internet can't contact your tivo anyway so it's useless to them.


----------



## Maui

Does anyone know the actual number to out in the variable for an 80 hour tivo?

Since I can't get the HME apps to work I would like to use this as a reference to how much freespace I have


----------



## gman622

Maui said:


> actual number to out in the variable for an 80 hour tivo?


what i would do is get the pie chart and assign 0 to totalGB in the TiVoPie.html file. if you've been using suggestions for awhile, the total shown at the bottom of the table should be fairly close to what's available.


----------



## doormat

morac said:


> It should be local for a number of reasons:
> 
> 1. It has your MAK in it and you don't want others to get that
> 2. People on the internet can't contact your tivo anyway so it's useless to them.


One is a good point, although my tivo does have a real routable IP I can connect to from anywhere.


----------



## gman622

morac said:


> 1. It has your MAK in it and you don't want others to get that


what could someone do with your media access key?


----------



## Maui

gman622 said:


> what i would do is get the pie chart and assign 0 to totalGB in the TiVoPie.html file. if you've been using suggestions for awhile, the total shown at the bottom of the table should be fairly close to what's available.


Doh!! I just deleted about 20 hours of suggestions and turned them off 

I guess maybe I'll have to turn them back on.


----------



## morac

gman622 said:


> what could someone do with your media access key?


Well for people like doormat, whose TiVo is open to the Internet, the media access key can be used to download shows off your TiVo and play them. All that's needed is the TiVo's ip address (also in the xhtml file) and an open port in your firewall (if you have one).

Distributing your MAK is also a violation of the TiVo's EUA and is justification for terminating your service.


----------



## Maui

Maui said:


> Does anyone know the actual number to out in the variable for an 80 hour tivo?
> 
> Since I can't get the HME apps to work I would like to use this as a reference to how much freespace I have


Well, The easier way I found was to average out the 3 or 4 programs I have recoded at Basic (averages about 750 mb per hour at basic) and multiply it by 80. It's not precise but should be close enough for me to use it fairly reliably.


----------



## ebf

I got the standard, built-in, nowplaying working, but can't seem to get any data out of this tool. I load the page and get the certificate prompt, and after a couple of minutes I get this:

*Now Playing - 0 Shows (0hr 0min using 0GB)*
~ 18hr 21min TimeLeft (@High)​
With an empty table below.

I am running the file locally on the same LAN as my TiVo and the edited file still has its correct extension.

Any ideas?

EBF


----------



## blm

_Any ideas?_

Did you enter your MAK correctly in the file? If it's not getting any data back, maybe it's because it can't log in.

Just a guess...

Brian


----------



## ebf

blm said:


> _Any ideas?_
> 
> Did you enter your MAK correctly in the file? If it's not getting any data back, maybe it's because it can't log in.
> 
> Just a guess...
> 
> Brian


Yup. I know I have the right MAK as the built in nowplaying works... I edited the new file using the same copy/paste that I used to test the built in. Anything else?


----------



## ebf

blm said:


> _Any ideas?_
> 
> Did you enter your MAK correctly in the file? If it's not getting any data back, maybe it's because it can't log in.


Well, I just tried a known bad MAK and I get the same thing. It must be something else...


----------



## ebf

ebf said:


> Well, I just tried a known bad MAK and I get the same thing. It must be something else...


WTF?!?OK, so I changed the to be EBF TiVo and removed what seemed to be unneeded returns in (my) line 2 and 4 (<!--save and <!DOCTYPE both were running to two lines) and now it is working! Weird. It must have been the extra returns as my "custom" title is not showing.

EBF


----------



## Kristo

boscodegama said:


> I made a small change to allow each Tivo the ability to have it's own TotalGB variable so that people with multiple tivos of different sizes can make use of that. What do you think?


First off - great job on this! I'm amazed at what some of you guys are able to do - wish I could code as well.

BOSCODEGAMA: Could you share your mod with us? I've got two different sized TiVos & would like the ability to have the total sizes specific for each. (better yet - can we just add his mod into the file?)


----------



## gman622

Kristo said:


> I've got two different sized TiVos & would like the ability to have the total sizes specific for each.


if i were you i'd just make two copies of the file (with two appropiately named bookmarks). then you can just have each tivo in it's own tab.


----------



## philbb

gman622 said:


> if i were you i'd just make two copies of the file (with two appropiately named bookmarks). then you can just have each tivo in it's own tab.


That's what I'm doing now, but I'd like to have them both on one page.

BTW, thanks for a great app!


----------



## gman622

updated this so you can have up to five tivo's (really as many as you want) each with their own capacity.
also added the time left at all 4 recording qualities.

*my version still won't work with >128 shows but if someone wants to donate to me a 140 hour tivo, i'll gladly rewite this from scratch to 'natively' support it


----------



## philbb

gman622 said:


> each with their own capacity.
> also added the time left at all 4 recording qualities.


Thank you so much for your work on this. I think it's great!


----------



## juanian

gman622 said:


> updated this so you can have up to five tivo's (really as many as you want) each with their own capacity.
> also added the time left at all 4 recording qualities.


A great looking script, but if only I could get it to work. Someone (? AnteL0pe) seemed to indicate that the script worked in Safari, but I can't get it to work (Safari 1.3 v312 running OS X 10.3.9).

I get errors like the following on all of the lines with the non-breaking space ( ): 
error on line 429 at column 106: Entity 'nbsp' not defined

Just for giggles, I changed them all to some other character and the errors went away, but then no output occurred (and the title remained 'Loading...').

I also tried running it in the old Mac IE, and it gave the "<![CDATA[" error (no surprise), and it *did* show a page with nothing filled in (which was more than Safari did).

Sniffing the line, it doesn't appear that Safari performed any network I/O. Java and JavaScript are enabled. I'm not sure how to check to see if any JavaScript errors occurred (nothing odd shows in the system or console logs).

The file does have the .xhtml suffix, and 'Hide Extension' is not checked. The IP address and the MAK is correct. Any thoughts? Am I SOL unless I go to FireFox?

(EDIT: I've tried the script from gman622 and morac - same results.)

Thanks


----------



## juanian

I tried the Pie Chart, and poking around in the script showed that it stopped at the 'new XSLTProcessor()' line.

I searched the web, and I find conflicting info on Safari support for XSLT. My version of Safari with my OS version is listed as supporting XSLT, but other places say that Safari will not support XSLT *in JavaScript* in this version (1.3) or a future version (2.0) anytime soon. My knowledge of XSLT is nil, so I don't know what is up.


----------



## f20clove

TO FIND RECORDING SIZE USE FORMULA: 
(MINUTES USED UP / 60 + HOURS USED UP) * CONSTANT OF QUALITY (BELOW)=X
TO FIND DISK SIZE USE FORMULA:
ANY RECORDING QUALITY HOURS AVAILABLE (FROM RECORDING QUALITY SETTING SCREEN) * CORRESPONDING CONSTANT OF QUALITY (BELOW)=X

CONSTANT OF QUALITY (GBs/HRs)

BASIC - 0.71492708454976447936942556673686
MEDEUM - 1.2133195698873329489129168247665
HIGH - 1.5934930351186972729056307631933
BEST - 2.5603296056503825779870512065921
​


----------



## f20clove

FOR HRs/GB USE FORMULA: 
1 / CONSTANT OF QUALITY (ABOVE)=X
​


----------



## cgt1z

When I click on the file, it prompts me for a username and password. 
itried to Use 'tivo' as the username and my MAK as the password. 
It does not work it still prompts, any other possibility?  
-------------------------
OK I figured out what I did. I entered the 14 digit tivo machine ID not the 10 digit media access key. One of the posts said the 14 digit nu and so I used the 14 digit number. 

This is a very cool app/ thanks for the work!


----------



## drosoph

Is this possible to run on a server, and access OUTSIDE a home network ? 
I can currently access my tivo's from outside my home network ... Just did some port redirects/whatnot ... but I cannot get the xhtml page to server via IIS6.

EDIT: I forgot to enable .xhtml file types on IIS. Now I cannot get the info to come up, but the page load .. with a shell. Only way I can get it to run is to put in file://c:/inetpub/yaddayadda ... I cant get http://localhost/yaddayadda to even work!


----------



## cmarrin

I'm glad I found this thread late! I downloaded the file, added my info (for 2 tivos) and it worked without a hitch! Thanks a lot. This is just what I have been looking for.

I have been playing with a lot of solutions to using my Linux home server as the media server for TiVo. I find TivoDesktop running on my PC to be an abomination with crashes, hangs, and generally slowing down my Windows PC. So I tried Galleon to move all this to my Linux server and found that to be just as bad. I am admittedly prejudiced against Java, but I found Galleon to be hard to use and inscrutible. Plus I don't need all that stuff.

I need to download video from my Tivos. This script is GREAT for that! I also need to server photos. I don't need to serve Music because I have a Squeezebox, which is a better solution for that, IMHO. I got the example Apache server from the Tivo site working pretty well.

So now all I need is to serve the videos I download BACK to the Tivos. I can do this using TivoDesktop. The shows I download to my PC show up in the Tivo Now Playing list under my server's name. Now I'd like to use the TiVoConnect.pm script to do that, but have not found anything on the web.

Anyone here trying to serve the videos downloaded to the PC back to the TiVos?


----------



## windracer

cmarrin said:


> Anyone here trying to serve the videos downloaded to the PC back to the TiVos?


You didn't like Galleon? 

It works great on my Linux box for doing everything you've described, including serving recordings back to the TiVo boxes on the network via TTCB. Since ComeBack transfers are initiated _from_ the TiVo itself, I'm not there's a scripted way to kick off those transfers (at least not until TiVo opens up more of their HME SDK).

Let me know if you want any assistance with Galleon on Linux, or check out the other Galleon-related threads around here.


----------



## Fraser+Dief

Anybody using this on Firefox 1.5? I just go the script warnings, then nothing but a blank page. The Javascript console shows (along with hundreds of errors from the boards here):

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.focus]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/tabbrowser.xml :: setFocus :: line 744" data: no]

Error: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXSLTProcessor.transformToFragment]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: file:///F:/Downloads/nowPlaying.xhtml :: anonymous :: line 78" data: no]
Source File: file:///F:/Downloads/nowPlaying.xhtml
Line: 78


----------



## windracer

I'm using Firefox, but I'm not actually executing the php script _through_ Firefox. I run the script via php on my Linux box and then just use Firefox to view the resulting files.


----------



## bonnie_raitt

I've tried this several times over the last two days, but get nothing but a blank screen. I am using Firefox 1.0.7. The Javascript console says

Error: totalCountMatch has no properties
Source File: file:///c:/TEMP/nowPlaying.xhtml
Line: 93

I have changed the IP address to that of my TiVo and the MAK to match mine. Any ideas?


----------



## bonnie_raitt

Doh!

I had the IP of the TiVo wrong. It now shows 23 shows playing. Thanks. Pretty Cool


----------



## TiVo Steve

Well done!!!
A quick question. I am new to the Series 2 units, how do you get the "extended" information (like guest actors) to display on the TiVo unit itself? I have not tried any "backdoors" codes on the Series 2 box yet! I do use them on my old Series 1.
Again, thank you, a very cool script!


----------



## TiVo Steve

I'm using Firefox 1.5 on a Linux box (running VectorLinux SOHO 5.1 and Galleon 1.92) and it works great!


----------



## morac

TiVo Steve said:


> Well done!!!
> A quick question. I am new to the Series 2 units, how do you get the "extended" information (like guest actors) to display on the TiVo unit itself? I have not tried any "backdoors" codes on the Series 2 box yet! I do use them on my old Series 1.
> Again, thank you, a very cool script!


If you are in the program info screen hit the info button to open up extra info.


----------



## gman622

awhile ago i updated this to support files transferring from pc to tivo (they show up in blue). today i made a small change to edit out the copyright tribune media... message that appears after *every* description.
by the way this (as well as the Pie Chart ) works fine in Firefox 1.5.


----------



## morac

There are a few errors in your new version and a problem in the old and new versions:

1. On line 574, the script will output the quality as "Unknown" if there is no source channel define. This should probably be changed to SourceSize.

2. On the same note, a few shows that I recorded on my TiVo are showing up as "PC:GREG" for some reason and the "details:show" link is missing. Your code seems to check if their is a source channel and if not it labels it as "PC:GREG". For whatever reason, there was no source channel for this recording even though it was recorded on the TiVo. Also even if there is no source channel, the option to display the program info should probably be allowed.

3. The whole algorithm for calculating quality seems to have a few flaws in it. A number of shows I recorded on High show as Medium. Currently the code takes the total size and divides this by (the show length in milliseconds divided by 1000). This has been like this for a while.

I recorded Smallville and if you look at the TiVoVideoDetails page for it on the TiVo it shows up as HIGH, but shows up as Medium here. It's sourcesize is 1391460352 and it's duration is 3601000. Using the algorithm in your code that would give it a Bps of around 386409. Since you code treats anything with a Bps between 300000 and 400000 as Medium, it is listed as Medium even though it was recorded on High quality. 

Since my TiVo's source is digital cable which is a cleaner signal, higher quality recordings don't always require more Bps.
It might be better to just read the value on the TiVoVideoDetails page since your code already reads that page to get the Expiration time.

I pulled in your changes and corrected #1 and #3 in my version (#3 by replacing the precalculated quality with the actual when it checks for the expiration time). As for #2, it should work as is, but I decided to key off the "ProgramId" key since that should always be set for shows recorded on the TiVo. I wouldn't think PC downloads would have that set, but I'm not positive.


----------



## gman622

morac said:


> the script will output the quality as "Unknown" if there is no source channel define. This should probably be changed to SourceSize.


i use the sourcechannel field in the xml file as a check for a .tivo file; if it isn't then there really isn't any notion of quality. the sourcesize is already in it's own column.



morac said:


> a few shows that I recorded on my TiVo are showing up as "PC:GREG"


that's my pc's name, i should have mentioned to do a search in the file and change that to whatever you like as a "source"



morac said:


> there was no source channel for this recording even though it was recorded on the TiVo. Also even if there is no source channel, the option to display the program info should probably be allowed.


that's strange, i've never had that happen. every show i've ever recorded had a sourcechannel. does this recording have a sourcestation?



morac said:


> Since my TiVo's source is digital cable which is a cleaner signal, higher quality recordings don't always require more Bps.


i don't think the signal has anything to with thie size of the recording (except on the old tivo's that have vbr recording). i never really futzed around with the algorithm because my recordings have been very very consistent as far as bps goes.



morac said:


> It might be better to just read the value on the TiVoVideoDetails page since your code already reads that page to get the Expiration time.


that would be the way to go but i didn't want to mess with my code that much and like i said my recordings have all been exactly the same size (within plus or minus 1 or 2 MB )



morac said:


> but I decided to key off the "ProgramId" key since that should always be set for shows recorded on the TiVo. I wouldn't think PC downloads would have that set, but I'm not positive.


maybe that is the better key to use; anyway that would be an easy change to make. just change line 574 from:


Code:


"not(t:Details/t:SourceChannel)"

to:


Code:


"not(t:Details/t:ProgramId)"


----------



## oyarzun

The download link no longer exists is there anywhere I can download the file? Thanks.

Found it searching "tivo now playing xhtml" on google. It's the first link.


----------



## gonzotek

oyarzun said:


> Found it searching "tivo now playing xhtml" on google. It's the first link.


http://my.opera.com/gman622/blog/show.dml/315486


----------



## tedbill

I took what Gonzotek has posted on his web page, pasted it into a text editor, made the changes to line 9 and 14, and saved it off as an XHTML file. When I try to open the file in FireFox I get the following:

XML Parsing Error: not well-formed Location: file:///c:/WINDOWS/Desktop/Untitled.xhtml Line Number 560, Column 55: <xsl:value-of select="$hr"/>:<xsl:if test="$min < 10">0</xsl:if><xsl:value-of select="$min"/>

Any idea what I'm doing wrong?


----------



## marty.mc

Same error here tedbill... what a bummer, I am really wanting to check this out!


----------



## marty.mc

Seems to have something to do with using the "<" instead of "&lt" but I cannot
figure out how to get the latter to work either...


----------



## marty.mc

Well I seemed to have figured out it was a prob with <![CDATA[ and ]]> not being
placed correctly. I started adding them in around the error(s) and it would pass
but find OTHER errors! Argh! What a recipe for a headache. Hopefully the original
author will throw us a line, otherwise we're outta' luck...?


----------



## morac

My link still works if you want to grab my version of the code. It is based off the latest version of gman's code.


----------



## marty.mc

Thanks morac. I can't seem to get a break on this... it works better than the other
I had downloaded, but now I get a mostly blank browser window except for a
disabled drop down menu thingy... argh.

I can access both TiVo's via the built in Now Playing using Firefox, so they are there
and running and accessable from this PC.

Bummer. Dude.


----------



## tedbill

morac said:


> My link still works if you want to grab my version of the code. It is based off the latest version of gman's code.


Thanks Morac, that did it for me! Neat tool . . .


----------



## marty.mc

It's working for me now... I think maybe I wasn't giving it enough time to download
the shows... but it is giving me warning about the certificate, which it didn't do the
last attempts... hmm. Well, thanks all!

I saw the formula earlier in this thread for how to calculate space on your TiVo... but
looking at it makes my head hurt! Anyone know the usable drive capacity of the
standard Series 2 80 hour TiVo?


----------



## jlc4

Did you use too much bandwidth? Could someone who has this repost in a different location? I'd like to check this out.

Thanks!


----------



## marty.mc

look 4-5 posts back... morac posted a link


----------



## gman622

I've been trying to get this to work with Opera 9 (they support xsltprocessor now) - unfortunately it doesn't seem possible. There's no way to do a cross-domain request (even one that's on the local network).
I even tried making an opera widget which would allow the cross-domain request, but they don't work with https sites.
One hacky workaround would be to write a script that downloads the xml files every few minutes.


----------



## morac

gman622 said:


> I've been trying to get this to work with Opera 9 (they support xsltprocessor now) - unfortunately it doesn't seem possible. There's no way to do a cross-domain request (even one that's on the local network).
> I even tried making an opera widget which would allow the cross-domain request, but they don't work with https sites.
> One hacky workaround would be to write a script that downloads the xml files every few minutes.


That's one of the reasons (of many) that I don't switch to Opera. It's a good browser, but it lacks some of the features and flexibility of Firefox. The main thing I like about Opera is it's page zooming features, but fortunately the same feature will be in Firefox 3.0.


----------



## gman622

morac said:


> That's one of the reasons (of many) that I don't switch to Opera. It's a good browser, but it lacks some of the features and flexibility of Firefox.


this page is the only reason I open up firefox. there are many reasons why I prefer Opera, but let's just say they're both very good browsers (and miles ahead of IE) and leave it at that.  
i did submit a bug report to opera to allow cross-domain requests for local files (the file:// protocol).
there is a way to get this to work using a reverse-proxy and Apache but that doesn't seem worth the hassle just to serve one page to myself. today i wote a little Python script that retrieves all the xml files every five minutes. not a great solution but at least it now works in Opera.


----------



## LordKronos

This thread is a bit old, but somehow I just stumbled across it now. I downloaded the code linked to from the first post, but it doesn't work in firefox 2. When I load the page, I keep getting "XML Parsing Error: not well-formed" errors about the "if test" and "when test" lines having the greater/less than comparisons. 

I see someone else pointed this out, but the issue was never addressed. Was there any resolution for it?


----------



## rtwolfe

morac said:


> My link still works if you want to grab my version of the code. It is based off the latest version of gman's code.


Morac - I ran into a problem with the new Amazon Unbox downloads, namely I didn't know that I did not have enough space on my Tivo to store the Amazon download. So, of course, the download just disappeared in the 'bit bucket'.

Was scanning for a way to see how much space I had available.
Your xhtml worked perfectly with Firefox 2.0.0.3
I DID have to tell firefox to ignore all the possible hazards of opening this xhtml code but by adding my tivo IP address from Tivo Desktop - Tivo Server Properties - Access Control and the Media Access Key (which I got from the Tivo webpage for managing my account.

Thanks again. This is a great solution.


----------



## ardee00

morac said:


> My link still works if you want to grab my version of the code. It is based off the latest version of gman's code.


morac: gman's file didn't work for me (Firefox 2, TiVo Series 2, TiVos have 8.x software) but YOUR DOES and I say THANK YOU!


----------



## AquaX

morac said:


> My link still works if you want to grab my version of the code. It is based off the latest version of gman's code.


Thanks! Still works great on Firefox 2.0.0.7 and Mac OS X 10.4.10.

For some reason, my copy from ages ago stopped working, but this one is fine.


----------



## cody_dingo

Seems that the Fall Update to 9.1 broke this. Can anyone else confirm?


----------



## morac

My S2 downloaded 9.1 but hasn't installed it yet. I'll try it tomorrow. If the XML data has changed then it most likely won't work.

Also remember that this won't work with S3's regardless until ToGo is enabled.


----------



## jessenj

I just tried the latest against my 9.1 S2 and while it shows that its downloading 54 of 54 shows, there are no results returned and the page is blank.


----------



## cody_dingo

jessenj said:


> I just tried the latest against my 9.1 S2 and while it shows that its downloading 54 of 54 shows, there are no results returned and the page is blank.


Yup. Same thing here. 9.1 on a Series 2 DT.


----------



## morac

It looks like TiVo added some additional fields to the XML data (and possibly removed a few). Since Gman662 doesn't seem to be around any more I can take a look at it, but unfortunately XSL isn't really my strong suite so I don't know how long it will take me to fix it.


----------



## pldoolittle

Fortunately, my new DT is still 8.3 and my old machines are 9.1. The 8.3 (Spring 07 update) works and the 9.1 (Fall 07) does not. I have compared the XML output and here are the new fields found in my output:

TivoContainer - Details - UniqueID
TivoContainer - Item - Description - HighDefinition
TivoContainer - Item - Description - EpisodeNumber
TivoContainer - Item - Description - ByteOffset


----------



## greg_burns

http://www.tivocommunity.com/tivo-vb/showthread.php?t=368760

Does the script reference the namespace? It has changed.


----------



## morac

Actually it does. I hope it's as simple as just changing that, but it might not be.

I can't try this at the moment, but if you open the nowPlaying.xhtml file change "calypso-protocol-1.5" to "calypso-protocol-1.6" and try it and tell me if it works.


----------



## jessenj

That did indeed fix it and I now see the full list of programs!!!


----------



## morac

Okay I made the change to the version I uploaded. I also add a "HD" column which lists if the show is in HD or not. It won't be very useful until ToGo is enabled on the S3, but I tested it by saving the XML data and changing the HighDefinition values to "yes" and then loading it and it works.

You can grab the 9.1 compatible version here.
I left the old version around for people who haven't got 9.1 yet.


----------



## cody_dingo

morac said:


> Okay I made the change to the version I uploaded. I also add a "HD" column which lists if the show is in HD or not. It won't be very useful until ToGo is enabled on the S3, but I tested it by saving the XML data and changing the HighDefinition values to "yes" and then loading it and it works.
> 
> You can grab the 9.1 compatible version here.
> I left the old version around for people who haven't got 9.1 yet.


Works great. Thank you.


----------



## morac

I accidentally reversed the quality and HD columns. I made a fix for this and uploaded it again.

Also I added an option to not grab the expiration date if the user so chooses. Just set the getExpires variable to false.


----------



## morac

I made a few more additions and re-uploaded here.

Here's the change list:

1. If you have more than one TiVo configured, there is now a button to press to get the data. I did this because I wanted to choose which TiVo without having to wait for the first one to download it's listings.

2. I added a copy protected column which indicates if the program is copy protected or not. Also if the program is copy protected I removed the download link since it doesn't work anyway.

3. The now recording items always listed as "planned". They should now correct indicate when they are suggestions.


----------



## bajaman

Thanks this has been one of my favorite scripts!!!

One question I've always been meaning to ask? How do you determine the total gigabytes used to record shows? I have to Tivo 240's with 160 GB drives. I calculated the hours used and the hours left to get an approximate number, seeing that I only record in BEST. I use 99.25, which almost matches my Recording stat in settings.

Is that correct or do you have a better way?

Thanks!!!


----------



## morac

The total GB of all the non-suggestion recordings is listed at the top. If you're TiVo is completely full (suggestions and scheduled recordings) with no free or deleted program, You can figure out the total GB using another program like TiVoPlayList. I guess I could add the total space used including suggestions at some point.

Also the quality values for the programs is a best guess based on the bitrate. It's not always correct but since the TiVo doesn't list the actual recording quality without digging down into each individual program (which takes time), it tries to guess based on the size and playing time.

Edit: It will update with the correct quality once it updates the expiration time. I usually just turn off the retrieval of the expiration time since I find no use for it.


----------



## bajaman

Thanks for the quick response.


----------



## cassiusdrow

morac said:


> I made a few more additions...


Any chance you could update the TiVoPie chart? It spits out a bunch of text since the 9.1 upgrade.


----------



## morac

I don't see anything noticeably wrong with the code, but I'll look into it.


----------



## morac

Your zip file is missing the tp.xsl file. Could you attach it?


----------



## cassiusdrow

Didn't know it used that. Added to the zip:


----------



## morac

Okay I think I fixed it, but I can't test it because there are 2 other files that are missing: TivoPie.class and ipr.png. The only real changed needed was in tp.xsl, but I modified TiVoPie2.html to allow the user to choose which TiVo before it downloads the listings (if there is more than one TiVo listed).

If it works, can you please attach the entire thing with all 4 files?


----------



## SeanC

So what's supposed to happen when I dbl click on nowplaying.xhtml?

I'm pretty sure I edited it correctly to add my MAK and tivo IP address but when I launch it Firefox opens and says Loading in the corner, but the screen itself is empty.

Any idea what the problem is?


----------



## morac

Assuming the ip address and MAK address is correct it should start downloading the show listings. It may put up a security warning message box, which you'd have to okay, since a script on the page is attempting to open a connection to the TiVo (which is considered a security risk by the TiVo). 

If absolutely nothing is happening, try checking the Error console (Tools->Error Console) for errors.


----------



## SeanC

K, thanks, I'll take a look at that when I get home.


----------



## cassiusdrow

morac said:


> Okay I think I fixed it, but I can't test it because there are 2 other files that are missing: TivoPie.class and ipr.png. The only real changed needed was in tp.xsl, but I modified TiVoPie2.html to allow the user to choose which TiVo before it downloads the listings (if there is more than one TiVo listed).
> 
> If it works, can you please attach the entire thing with all 4 files?


Thanks for you help!

Here's the full package. I didn't realize it required more than the html file.


----------



## SeanC

Got around to looking at it last night. I had edited the wrong line with an IP address, it was commented out. Fixed that and everything is working now.

Great work Morac!

TivoPie is great too!


----------



## dturturro

LordKronos said:


> This thread is a bit old, but somehow I just stumbled across it now. I downloaded the code linked to from the first post, but it doesn't work in firefox 2. When I load the page, I keep getting "XML Parsing Error: not well-formed" errors about the "if test" and "when test" lines having the greater/less than comparisons.
> 
> I see someone else pointed this out, but the issue was never addressed. Was there any resolution for it?


I see the same error. Are we missing something?


----------



## judithdrive

dturturro said:


> I see the same error. Are we missing something?


I had the same problem too, so I looked at the code and saw some XSLT quoting errors. I changed those and it seems to work fine in Firefox. The code window below shows the lines I changed, with the actual changes marked in red.



Code:


NowPlaying Fixes
Produced: 4/27/2008 5:54:48 PM
    
Mode:  Just Differences   
    
Left file: nowplaying-original.xhtml   
Right file: nowplaying.xhtml   
  
L567       <xsl:value-of select="$hr"/>:<xsl:if test="$min [COLOR="Red"]<[/COLOR] 10">0</xsl:if><xsl:value-of select="$min"/> 
R567       <xsl:value-of select="$hr"/>:<xsl:if test="$min [COLOR="red"]&lt;[/COLOR] 10">0</xsl:if><xsl:value-of select="$min"/> 
  
L584      <xsl:when test="$bs > 400000 and $bs [COLOR="red"]<[/COLOR] 600000">High</xsl:when> 
R584      <xsl:when test="$bs > 400000 and $bs [COLOR="red"]&lt;[/COLOR] 600000">High</xsl:when> 

L585      <xsl:when test="$bs > 300000 and $bs [COLOR="red"]<[/COLOR] 400000">Medium</xsl:when> 
R585      <xsl:when test="$bs > 300000 and $bs [COLOR="red"]&lt;[/COLOR] 400000">Medium</xsl:when> 
  
L688       <xsl:value-of select="$hr"/>:<xsl:if test="$min [COLOR="red"]<[/COLOR] 10">0</xsl:if> 
R688       <xsl:value-of select="$hr"/>:<xsl:if test="$min [COLOR="red"]&lt;[/COLOR] 10">0</xsl:if> 
  
L705      <xsl:when test="$bs > 400000 and $bs [COLOR="red"]<[/COLOR] 600000">High</xsl:when> 
R705      <xsl:when test="$bs > 400000 and $bs [COLOR="red"]&lt;[/COLOR] 600000">High</xsl:when> 

L706      <xsl:when test="$bs > 300000 and $bs [COLOR="red"]<[/COLOR] 400000">Medium</xsl:when> 
R706      <xsl:when test="$bs > 300000 and $bs [COLOR="red"]&lt;[/COLOR] 400000">Medium</xsl:when> 
  
L741    <xsl:otherwise>[COLOR="red"]<[/COLOR]1</xsl:otherwise> 
R741    <xsl:otherwise>[COLOR="red"]&lt;[/COLOR]1</xsl:otherwise> 
  
L795 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&[/COLOR]select=People"> 
R795 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&amp;[/COLOR]select=People"> 
  
L811 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&[/COLOR]select=People"> 
R811 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&amp;[/COLOR]select=People"> 
  
L827 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&[/COLOR]select=People"> 
R827 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&amp;[/COLOR]select=People"> 
  
L843 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&[/COLOR]select=People"> 
R843 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&amp;[/COLOR]select=People"> 
  
L859 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&[/COLOR]select=People"> 
R859 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&amp;[/COLOR]select=People"> 
  
L875 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&[/COLOR]select=People"> 
R875 <a class='search' href="http://www.imdb.com/Find?for={$fname}%20{$lname}[COLOR="red"]&amp;[/COLOR]select=People">


----------



## nickhaas33

Has anyone gotten this Ajax script to work on Firefox 3 Beta 5?
The initial screen pops up that lets you select one of your TIVOs.
It then prompts you if you really want to run this thing,
Then you just get a DONE message at the bottom left.

Thanks


----------



## morac

The problem is a new security feature in Firefox 3.0. The TiVo returns a self signed certificate which Firefox by default won't trust and blocks the connection.

Here's the steps to fix this:

1. Open the Firefox options menu by clicking Tools->Options.
2. In the options, go to the Advanced options and click "View Certificates".
3. In the Certificate Manager, go to the "Servers" tab and click "Add Exception..."
4. In the "Add Security Exception" window enter the TiVo's ip address from the nowplaying file after the https:// in the location textbox. For example if the ip address is 192.168.1.5, then enter https://192.168.1.5.
5. Click Get Certificate and then make sure the "Permanently store this exception" checkbox is checked and click "Confirm Security Exception".

Repeat steps 3 to 5 for each TiVo.
Now it will work.


----------



## nickhaas33

That did the trick.
Thanks very much!


----------



## diskus

Can someone point me to the current version of the nowplayiNG XHTML FILE?


----------



## SJMarty

diskus said:


> Can someone point me to the current version of the nowplayiNG XHTML FILE?


I got it from here...

http://anonymous123.home.comcast.net/~anonymous123/nowPlaying.xhtml

-SJM


----------



## SJMarty

Does anyone else get a series of "Internet Security" messages stating that the file wants to "Read private data from any site or window" (see attached).

I get about eight of these. I have the option to "Allow" or "Deny" and a checkbox to "Remember this decision". I click "Allow" about eight times and everything seems to come up OK except there is a lone "Internet Security" window that stays up with the "Allow" option grayed out.

I am using XP Professional SP3 and Firefox v3.0 Final. Anyone else seeing this behavior?

BTW, I am using the "NowPlaying" link from the previous post above. Thanks.

-SJM


----------



## morac

I'm not sure which window you are talking about since there's nothing attached, but the warnings come up because the file needs to violate Firefox's same origin policy. This is what prevents scripts from one web site from initiating network connections to a different site. In this case a local page want's to access the TiVo. In order for this to work, the page must ask Firefox for extra permissions which in turn prompts the user.

Basically Firefox is asking is it okay for the page to initiate a network connection. It needs to ask every time a network connection is made (unless you click the remember option). Another option is to set up a security policy. See this thread for an example.

Since by default the script only grabs 10 items at a time, it needs to make 8 connections to grab between 70 to 80 items. You can change the number of items grabbed at a time by modifying the "itemCount" number at the top of the file.

Also Firefox 3.0 has extra safeguards to prevent accessing encrypted pages that are self-signed. You'll need to follow the steps in post 156 above to get around this.


----------



## morac

I noticed that the current version wasn't displaying the channel numbers only the channel name. It used to display the numbers, but something changed so I fixed it to display the numbers again. As usual it's available at http://anonymous123.home.comcast.net/~anonymous123/nowPlaying.xhtml

Read this post to get it working in Firefox 3.0 and the post above this one for info about the security warning messages.

Read


----------



## DaGhost

I know this is an old thread but just in case anyone else runs into the problems I had. Maybe someone else besides me searches threads before posting questions!!

*PROBLEM:*
I downloaded this file to my Windows XP desktop then right-clicked and selected Edit from the menu. When I did this it automatically opened the file in MS Word. I then selected View-- HTML Source and was greeted with the HTML code.

I made the changes to the IP address and MAK settings and then saved my work and exited back to the desktop. When launching the file I received this error.

_XML Parsing Error: not well-formed
Location: file:///C:/Documents%20and%20Settings/MyName/Desktop/nowPlaying.xhtml
Line Number 12, Column 18:_

*CAUSE:*
It would appear that MS Word had added several dozen lines to the code that was fouling this up.

*SOLUTION:*
When I opened the file in Notepad and made my changes there, it worked like a charm.

DaGhost


----------



## morac

I'd avoid MS Word for modifying any HTML files, let alone a XHTML/XML file (which this is) since, like you saw, it tends to add a lot of garbage to the HTML file making it next to unreadable.


----------



## SJMarty

Does anyone know what the "total gigabytes used to record shows" value should be for a TiVoHD? Thanks.

-SJM


----------



## orourkj

Thanks to this thread and the latest version of the NowPlaying file I can get details on what is on my older Tivo - a 40 hour standard def Tivo that's several years old. However, I cannot get this file to work against our newer HD Tivo. I've tried including it by itself in the file as well as one of two tivos in the same NowPlaying file.

I don't get any errors, just nothing ever loads. The older Tivo loads up in just a few seconds, but the new Tivo never loads. I scanned this thread and don't see the solution. Both Tivo IPs are listed as exceptions to security certificates in Firefox.

Any help?


----------



## morac

How new is the HD? It can take a day or two to allow inbound connections. You can test if the TiVo is networked correctly by going to its built in web page at:

http://tivoip/index.html where tivoip is the TiVo's ip address. This should bring up a Congratulations page.

If that works, then try the same thing except use https instead of http. This requires you to log in. The username is tivo and the password is your MAK number.

If that works, then check for errors in Firefox's error console since some extensions such as NoScript can cause it to fail.


----------



## orourkj

Thanks for the response

Unfortunately I didn't have any luck with your suggestions. I tried the 4 addresses below and got Page Load Errors each time

http://192.168.0.101/index.html
http://192.168.0.102/index.html
https://192.168.0.101/index.html
https://192.168.0.102/index.html

Afterwards I tried my nowPlaying file again, and confirmed I can still get at 192.168.0.101 but not 192.168.0.102.

The HD Tivo we've had for a year or so and its worked fine with no apparent problems.

I checked the Firefox error console and saw no related entries.

Help?


----------



## morac

The nowPlaying file needs to be able to access the data off the TiVos. If the http://tivoip/ address fails to load then something is wrong with your network connection to the TiVo.


----------



## orourkj

The NowPlaying file loads successfully off my old tivo and both Tivos successfully connect everyday to the Internet for their updates. They clearly are connected to the network, I'm just not able to connect to them with these tips yet.


----------

