Squak Mountain Consulting, Inc.

TIVO Size - Get the disk space used on your TIVO.



TIVO Size - Get the disk space used on your TIVO.

This information is provided for educational purposes only.
You take all the responsibility for your use of this information.
There is no warranty, no support, no assurances.
There are errors in this information.
If you hurt yourself and/or others, it's your fault.
If you destroy your equipment or invalidate the warranties, it's your fault.

This disclaimer brought to you by one of the best justice systems on Earth.
This web page copyright © 2009 Squak Mountain Consulting, Inc.


You want to know how much disk space is being used by recordings on your TIVO.
Your TIVO has a web page that lists the recordings and the size of each one.
But, no totals are provided.
This script creates totals in both MB and GB, right after the "Now Playing" title.

Now Playing - MB used = 132133 - GB used = 129

Source DescriptionDateSizeLinks
DSCP Cash Cab
Thu
1/22
0:31:00
800 MB
Download MPEG-PS

Prerequisites:
TIVO connected to your home network ( http://192.168.1.100, in these examples )
You have access to the TIVO web page at: https://192.168.1.100/nowplaying/index.html?Recurse=Yes
Firefox web browser, or equivalent
Grease Monkey installed in your web browser.

Username and Password:
When you browse to your TIVO web page, you will be asked for your Username and Password.
The Username is always "tivo".
The Password is the Media Access Key (MAK) assigned to your Tivo by the Tivo service.
There are at least two ways to discover the MAK:
  1. On your tivo go to TiVo Central, Messages & Setup, Account and System Information, Media Access Key.
  2. On your tivo.com account at https://www.tivo.com/accesskey
If you have Firefox save the Username and Password, you will not be challenged by this prompt again.

Install:
Install the script into Grease Monkey. The install process varies by platform. Often, you just drag and drop the script into your browser.
Go to the Grease Monkey "Manage User Scripts" dialog
Select the tivosize script, remove all the "included pages" for it, and add this as the only included page: https://192.168.1.100/*
Close the "Manage User Scripts" dialog
Test the web page: https://192.168.1.100/nowplaying/index.html?Recurse=Yes
That's it.  I hope it works for you as smoothly as it did for me.

Advertisements - Please visit my sponsors and help support development!

GreaseMonkey Script: tivosize.js
// ==UserScript==
// @name           tivosize
// @namespace      my
// @description    Total recording sizes
// @include        file:///root/tivo/tivosize/tivosize.js
// ==/UserScript==

window.addEventListener( 'load', function() { 
  GM_log("load complete" );

  // get the page URL like: 'https://192.168.1.100/nowplaying/index.html?Recurse=Yes'
  var mytest = window.location.href;
  GM_log("href=" + mytest.length + " - '" + mytest + "'" );

  // Make sure the page URL is the one we want to process
  // If not, return before we do anything
  mypath = "\/nowplaying\/index.html";
  mysearch="Recurse=Yes";

  var mypathfound = mytest.match(mypath);
  var mysearchfound=mytest.match(mysearch);
  
  if ( mypath == mypathfound ){
      GM_log("mypath == mypathfound");
    } else {
      GM_log( "mypath NOT found, ending, requires TIVO URL /nowplaying/index.html?Recurse=Yes");
      return; 
    }
  if ( mysearch == mysearchfound ){
    GM_log("mysearch == mysearchfound");
    } else {
      GM_log( "mysearch NOT found, ending, requires TIVO URL /nowplaying/index.html?Recurse=Yes");
      return; 
    }
  // We are now finished validating the page URL is the one we want to process
  // If we get here, we want to process this page

  var cells = document.getElementsByTagName("th"); // get the table header cells

  if ( cells[4].lastChild.nodeValue != "Size" ){   // require a "Size" column to work
    GM_log( " Size column NOT found, ending");
    return; 
    }

  var cells = document.getElementsByTagName("td"); // get the table data cells

  var mysize=0                              // will hold our MB used

  for (var i = 0; i < cells.length; i++) {  // for every table cell

    var mytest  =(2+i)%6                    // are we in the size column?
    if ( mytest==0 ){

      data1 = cells[i].lastChild.nodeValue; // get size, like: "800 MB"
      var dsplit = data1.split(" ")         // split it into 2 pieces, like: dsplit[0]="800"  dsplit[1]="MB"

      // convert numbers to megabytes
      var mymult = 1;
      var mymultstr = dsplit[1];
      if ( mymultstr == "KB" ){ mymult =    0.0009765625 } // reciprocal of 1024, a binary thousand
      if ( mymultstr == "MB" ){ mymult =    1            }
      if ( mymultstr == "GB" ){ mymult = 1024            }

      mynum = parseFloat( dsplit[0] ) * mymult; // convert the characters to a number
      mysize = mysize + mynum;                  // add to total MB

      }
    }

    GM_log( "mysize total=" + mysize );
    myMBdisplay = Math.floor( mysize );
    myGBdisplay = Math.floor( mysize/1024 );

    mytest = document.getElementsByTagName('h1');

    var oldheader = mytest[0].textContent;
    mytest[0].textContent = oldheader + " - MB used = " + myMBdisplay + " - GB used = " + myGBdisplay;

  }, true);