Sam Widges
Active Member
In preparation for returning my HDR for repair, I'm working on a couple of scripts to help people in a similar position make the best of a bad situation.
This script will read the contents of your HMT files (one of the sidecar filetypes) and will produce a sorted list of the filename and the programme info. Therefore, even if you move the files elsewhere, you can store the output of this script as well and have a better index - with a bit of tweaking, you could even turn the output into a webpage and make it browseable.
Here is some output from the tail end of my last run:
Here is the script for 'infofinder.pl' itself
Please note, the script was written to be flexible and easily modified and for my own use (it's not pretty!), but if anyone wants to have a play or to convert it into jim, let me know.
To run the script, you will need to be running the custom firmware and have the perl package installed then it's simply a matter of
This script will read the contents of your HMT files (one of the sidecar filetypes) and will produce a sorted list of the filename and the programme info. Therefore, even if you move the files elsewhere, you can store the output of this script as well and have a better index - with a bit of tweaking, you could even turn the output into a webpage and make it browseable.
Here is some output from the tail end of my last run:
Code:
Wives and Daughters_20110617_0400
Scandal and Its Victim
Lady Harriet tries to redeem Molly's reputation and Cynthia has to face up to her past. With Tom Wilkinson and Angela Pleasence. Episode 8 of 9.
Wives and Daughters_20110618_0400
Reviving Hopes and Brightening Prospects
What will become of Osborne's wife and child? And is a marriage proposal on its way to Cynthia? Starring Kathryn Hurlbutt. Episode 9 of 9.
Zodiac_20110522_2201
Thriller based on real events, dramatising cartoonist and author Robert Graysmith's attempts to identify the so-called Zodiac killer. [2007] [AD,S]
Here is the script for 'infofinder.pl' itself
Code:
use strict;
my @hmtfiles = `find "/mnt/hd2/My Video" -name '*.hmt'`;
my %fileinfo;
foreach my $file (@hmtfiles) {
#print "Processing: $file";
local $/ = "\0";
open INFILE, "<$file";
binmode INFILE;
my $prog;
read (INFILE, $prog, 383);
$prog = <INFILE>;
my $filename = $prog;
#print "$prog\n";
my $length = (666-383-length($prog));
read (INFILE, $prog, $length);
$prog = <INFILE>;
my $title = $prog;
#print "$prog\n";
$length = (1303-666-length($prog));
read (INFILE, $prog, $length);
$prog = <INFILE>;
#print "The marker: $prog\n";
$length = (1559-1303-length($prog)+index ($prog,$title));
read (INFILE, $prog, $length);
$prog = <INFILE>;
#print "$prog\n";
close INFILE;
$fileinfo {$filename}=$prog;
}
foreach my $key ( sort keys %fileinfo ) {
print "$key\n";
$fileinfo{$key} =~ s/: /\n/;
print "$fileinfo{$key}\n\n";
}
Please note, the script was written to be flexible and easily modified and for my own use (it's not pretty!), but if anyone wants to have a play or to convert it into jim, let me know.
To run the script, you will need to be running the custom firmware and have the perl package installed then it's simply a matter of
Code:
perl infofinder.pl