#!/bin/sh # # First arg is base name of file to store download in (this script will # append .mpg to the name). # # Second arg is the URL, probably obtained via Copy Link Location in web # browser pointed at the tivo box (almost certainly need to put this in # quotes). # # Downloads the file from the tivo to $1.mpg in current directory # (takes about 4 or 5 minutes per gigabyte). # # The ultra secret media access key provided by the tivo box: # mediakey=nnnnnnnnnn # if [ $# -ne 2 ] then echo usage get-tivo destination-file-name tivo-url 1>&2 exit 2 fi cookies=/tmp/$$cookies.txt filename=$1 shift if [ -f "$filename.mpg" ] then echo "$filename.mpg" already exists, not downloading. 1>&2 exit 2 fi echo Starting file transfer, this will probably take a while... curl -s --digest -k -u tivo:$mediakey -c $cookies --cookie "sid=abc" "$@" | \ tivodecode --mak $mediakey -n -o "$filename.mpg" - rm -f $cookies ls -l "$filename.mpg"