Previous section   Next section

Hack 96 Making Recordings Start Late and End Early

figs/moderate.giffigs/hack96.gif

Only interested in your local news for tomorrow's weather report, but you find yourself having to fast forward through the whole thing every night? By altering TiVo's resources, you can allow scheduled recordings of only the portion of a show you're interested in.

While scanning your TiVo's mind (a.k.a. resources) can make for some interesting reading, there are actually all sorts of things you can do by writing to it. This hack does more than make a cosmetic change to a menu or tweak a display setting; it actually changes the way TiVo works.

The script adds negative values to the Start Recording and Stop Recording options, allowing you to start recordings late and end them early, not just start early and end late. This is useful for recording tomorrow's weather forecast�the last 10 minutes of your local 10 o'clock news�without having to record the whole broadcast and fast forward your way through.

As is, this hack will work only under TiVo OS 3.x.

The Code

Mike Baker wrote this padhack.tcl script, which modifies resource group 32, items 19 and 21, which supply values to the Start Recording and Stop Recording options.

#!/tvbin/tivosh

EnableTransactionHoldoff true

set db [dbopen]
RetryTransaction {
  # get handles to the right database entries
  set swsysa [db $db open "/SwSystem/ACTIVE"]
  set tmpgrp [dbobj $swsysa get ResourceGroup 32]

  # add new values for the start recording times
  set tmpres [dbobj $tmpgrp get "Item" 19]
  dbobj $tmpres set String "On-time|0|1 minute early|60|2 minutes[RETURN]
  early|120|3 minutes early|180|4 minutes early|240|5 minutes early|300|10[RETURN]
  minutes early|600|1 minute late|-60|2 minutes late|-120|3 minutes late|[RETURN]
  -180|4 minutes late|-240|5 minutes late|-300|10 minutes late|-600|"[RETURN]
  # add new values for the stop recording times[RETURN]
  set tmpres [dbobj $tmpgrp get "Item" 21]

  dbobj $tmpres set String "On-time|0|1 minute longer|60|2 minutes[RETURN]
  longer|120|5 minutes longer|300|15 minutes longer|900|30 minutes[RETURN]
  longer|1800|1 hour longer|3600|1 1/2 hours longer|5400|3 hours[RETURN]
  longer|10800|1 minute shorter|-60|2 minutes shorter|-120|3 minute[RETURN]
  shorter|-180|4 minutes shorter|-240|5 minutes shorter|-300|10 minutes[RETURN]
  shorter| 600|"
  
  dbobj $tmpgrp remove "CompressedFile"
}

To understand how this works, run dump.tcl [Hack #94] and find resource group 32. You'll see that item 19 dictates values for the Start Recording offset, and item 21 controls the Stop Recording offsets:

32 19 {On-time|0|1 minute early|60|2 minutes early|120|3 minutes early|180|4 
minutes early|240|5 minutes early|300|10 minutes early|600|}
...
32 21 {On-time|0|1 minute longer|60|2 minutes longer|120|5 
minutes longer|300|15 minutes longer|900|30 minutes longer|1800|1 hour longer|3600|1 
1/2 hours longer|5400|3 hours longer|10800|}

Save the code as padhack.tcl in TiVo's /var/hack/bin directory and make it executable:

bash-2.02# chmod 755 /var/hack/bin/padhack.tcl

Running the Hack

Run the script from TiVo's command line Section 3.3:

bash-2.02# /var/hack/bin/padhack.tcl

Reboot your TiVo, schedule a recording, and visit the Recording Options screen to see your changes in effect, as shown in Figure 7-4. Cool, huh? And it's useful if all you want to see is the Top 10 List at the beginning of a late night talk show, the weather report at the end of the news, headlines at the top of every hour on CNN, and so forth.

Figure 7-4. Setting your Season Passes to start late and end early
figs/tivo_0704.gif

You have to run the script only once, because the altered settings persist through reboots.

Hacking the Hack

You're not confined to the changes you've just made. Take a closer look at the lines starting with dbobj $tmpres set in the padhack.tcl code. The groupings inside the { and } actually set the values for the TiVo. For example, On-time has an offset of 0, while a minute early has an offset of 60, and so forth.

We can insert any custom value that we want. Change it to look like this:

dbobj $tmpres set String "On-time|0|1 minute early|60|2 minutes early|120|3[RETURN] 
minutes early|180|4 minutes early|240|5 minutes early|300|10 minutes[RETURN] 
early|600|17 minutes early|1020|1 minute late|-60|2 minutes late|-120|3[RETURN] 
minutes late|-180|4 minutes late|-240|5 minutes late|-300|10 minutes late|[RETURN]
-600|"

That new 17 minutes early|1020 segment adds the ability to the stop recording 17 minutes from the end of a program.


  Previous section   Next section
Top