Robstarusa
12th February 2003, 18:14
Hello,
After manually scheduling shows for my Radeon AIW using titantv's two week lead (the guide+ one week lead sucks!), I developed a utility to create a registry file for windows.
Currently, a rough version of the utility is written in PHP (I had it php available, and it was easy to debug), and it seems to work ok.
It works like this:
You log into the titan tv page with your own account, and look at the listings. Then go to the search area and search for a show you want to record. Save the resulting html file. This utility processes that file and creates appropriate registry entries. Double click on the .reg file and it will enter the registries entries into windows.
How it works:
(tested in sh on OpenBSD 3.2)
# php < tv.php > ./debugoutput.html
Features supported:
* Processes entire 2 week schedule from titantv (Actually if titan tv ever showed more or less than 2 weeks, it should work fine too)
* Supports starting recording of ALL instances of a show x minutes early and recording y extra minutes
* FileNaming of saved shows is Showname_Episodename
* Supports custom show durations for each set of shows
* Anything in the registry entry created by the manual scheduler can be edited/changed in the source of my program.
Requirements:
* Unix machine with php installed
(probably will work with windows PHP interpreter, but you might have
to change path/file names and / vs \.)
* Windows machine with ATI AIW installed (tested with the original AIW RADEON SDR).
Future Features:
* Having a file with a list of files to process and doing each one and creating one big .reg file
* Taking user input instead of editing the source file.
* Possibly putting it in a web page and accepting form input & returning a file to the browser
* Converting to run on C/Windows in a nice gui.
Features that will NOT ever be written by me:
* Automatically Connecting to titantv.com, putting in a user & pass and doing it automagically -- I've already read about screen scraping lawsuits.
This is available under GPL.
Rob
Post here or mail me atitv@quadwhore.com if anyone is interested. The whole utility is about 8k
Ookami
12th February 2003, 22:56
Why don't you attach it here, or upload it to Geocities or similar?
Robstarusa
12th February 2003, 23:03
It's just text. Are you interested in downloading it ? I'll put it up on my website, just say the word and I'll post a link.
Rob
P.S. You wouldn't be from Zagreb, would you ? My friend (here in Chicago) is from t here.
Ookami
13th February 2003, 02:24
Originally posted by Robstarusa
It's just text. Are you interested in downloading it ? I'll put it up on my website, just say the word and I'll post a link.
Rob
P.S. You wouldn't be from Zagreb, would you ? My friend (here in Chicago) is from t here.
Well, post the "text" here :) . I don't have a ATI card, anymore, so I don't have any use for it. But, there are others who would benefit from it, I bet.
I will also link this thread in the FAQ, so please post it here. Thanks. :)
<Nitpick> I'm not from Zagreb, altough I live in it :D . </Nitpick>
Good night,
Mijo.
Robstarusa
13th February 2003, 03:59
// NO WARRANTIES AT ALL. USE AT YOUR OWN RISK
// CODE RELEASED UNDER GPL.
// Please see http://www.gnu.org/licenses/gpl.txt for full licensing information
// USER DEFINED SETTINGS
// in your registry, each show recorded is under a certain key, starting at 0,1,2,3.
// Here, put the next available (non-used number)
$newregkey=114;
// 30 minutes = 708, 60 minutes=E10, 120 minutes = 1C20, 90 minutes= 1518
$_Duration="\"Duration\"=dword:00000708";
// Change as appropriate! Used for naming files that are captured.
$showname="Married";
// The saved scheduled .htm file from titantv.com
$filename="/home/rob/tv/" . $showname . ".html";
$outregfilename="/home/rob/tv/" . $showname . ".reg";
// Length of each episode
$showduration="30";
// How many minutes to start before actually recording
// each show
$preshow=1;
$postshow=0;
// This is the path where you want the files saved. Don't forget to escape the \
$_Path="\"Path\"=\"Z:\\Simpsons";
$_H[0]="Windows Registry Editor Version 5.00";
// [HKEY_CURRENT_USER\Software\ATI Technologies\Multimedia\Features\Schedule\1]
$_H[1]="[HKEY_CURRENT_USER\\Software\\ATI Technologies\\Multimedia\\Features\\Schedule\\";
$_Name="\"Name\"=\"";
$_On="\"On\"=dword:00000001";
$_Every="\"Every\"=dword:00000000";
$_Date="\"Date\"=\"";
$_Time="\"Time\"=\"";
$_Active="\"Active\"=dword:00000001";
$_Feature="\"Feature\"=\"DSVCAP\"";
// [HKEY_CURRENT_USER\Software\ATI Technologies\Multimedia\Features\Schedule\1\Capture]
$_H[2]="[HKEY_CURRENT_USER\\Software\\ATI Technologies\\Multimedia\\Features\\Schedule\\";
// Do 1 sample show through Guide+ software and see what is put here. replace 3 with number Guide+ gives you
$_Quality="\"Quality\"=dword:00000003";
$_Pattern_ID="\"Pattern ID\"=dword:00000000";
// [HKEY_CURRENT_USER\Software\ATI Technologies\Multimedia\Features\Schedule\1\Capture\Pattern Data]
$_H[3]="[HKEY_CURRENT_USER\\Software\\ATI Technologies\\Multimedia\\Features\\Schedule\\";
// This will be auto determined by the episode name. This is the name of the file it will be saved as.
$_Custom="\"Custom\"=";
// [HKEY_CURRENT_USER\Software\ATI Technologies\Multimedia\Features\Schedule\1\Tuner]
$_H[4]="[HKEY_CURRENT_USER\\Software\\ATI Technologies\\Multimedia\\Features\\Schedule\\";
// This will be auto determined from the scheduling information. It's represented as Hex"
// eg: channel 64 = 40
$_Channel="\"Channel\"=dword:";
//[HKEY_CURRENT_USER\Software\ATI Technologies\Multimedia\Features\Schedule\1\Video]
$_H[5]="[HKEY_CURRENT_USER\\Software\\ATI Technologies\\Multimedia\\Features\\Schedule\\";
// Not Keys under here (perhaps for s-video or composite capture ?
// [HKEY_CURRENT_USER\Software\ATI Technologies\Multimedia\Features\Schedule\1\Video\Analog TV Tuner]
$_H[6]="[HKEY_CURRENT_USER\\Software\\ATI Technologies\\Multimedia\\Features\\Schedule\\";
// No idea what this is
$_ID="\"ID\"=dword:00000031";
// No idea what standard is ...tv standard ? NTSC/pal/secam/etc ?
$_Standard="\"Standard\"=dword:00000001";
// 0 = off ? who knows
$_NoiseReduction="\"Noise Reduction\"=dword:00000000";
// No idea
$_Fields="\"Fields\"=dword:00000000";
// I think these are self explanatory.
$_Color="\"Color\"=dword:00000080";
$_Tint="\"Tint\"=dword:00000080";
$_Bright="\"Bright\"=dword:00000080";
$_Contrast="\"Contrast\"=dword:00000080";
$_Temperature="\"Temperature\"=dword:00000000";
// Lets open the file and write the first few headers:
$writehandle=fopen($outregfilename,w);
echo "writehandle=$writehandle";
fwrite($writehandle,"$_H[0]\n");
////////////////////////////////////////
// LETS BEGIN, OPEN THE FILE
// open file for reading, import into one array
$filehandle = implode("", file($filename));
// One episode per array location:
//$rowarray = explode("<b>$showname</b>",$filehandle);
$tablearray = explode("<table",$filehandle);
// how many rows are there in the scheduling table?
$tables=count($tablearray);
echo "there are $tables tables in tablearray<br>";
echo "<pre>";
for ($i=0;$i<$tables;$i++)
{
$rowarray = explode("</tr>",$tablearray[$i]);
$rows=count($rowarray);
echo "There are $rows rows in table $i<br>";
for($j=0;$j<$rows;$j++)
{
// if (($i==15) && ($j==3))
// {
// echo "table[$i]row[$j]=$rowarray[$j]";
// }
$cellarray = explode("</td>",$rowarray[$j]);
$cellcount = count($cellarray);
for($k=0;$k<$cellcount;$k++)
{
//echo "table[$i]row[$j]cell[$k]=$cellarray[$k]<br>";
// This is where the episode name is
if (($i==17) && ($j>=2) && ($k==1))
{
//echo "cellarray[$k]=$cellarray[$k]";
$startat=strpos($cellarray[$k],"<br>")+4;
//echo "startat=$startat";
$totlength=strlen($cellarray[$k])-$startat;
$title=substr($cellarray[$k],$startat,$totlength);
echo "Title=$title on ";
}
// This is where the channel number is
if (($i==17) && ($j>=2) && ($k==3))
{
$startat=strpos($cellarray[$k],">")+1;
$totlength=strlen($cellarray[$k])-$startat;
$channel=substr($cellarray[$k],$startat,$totlength);
echo "$channel";
}
// This is where the date & time are
if (($i==17) && ($j>=2) && ($k==4))
{
$startat=strpos($cellarray[$k],">")+1;
$totlength=strlen($cellarray[$k])-$startat;
$dtime=substr($cellarray[$k],$startat,$totlength);
echo " datetime=$dtime ";
if (strpos($dtime,"PM")) { $PM=1; } else {$PM = 0;}
$dtime=explode("/",$dtime);
$month=$dtime[0];
$day=$dtime[1];
$year=substr($dtime[2],0,4);
$time=substr($dtime[2],5,strlen($dtime[2])-5);
echo "month= $month, day=$day, year=$year ";
// Find out if the show starts on an even hour or has a :
// a : indicated we can grab the hour before the : and the minutes after
if (strstr($time,":"))
{
//Ok, it's not an even hour, lets roll
//echo " FOUND : ";
$hour=0;
$hour=substr($time,0,strpos($time,":"))+$hour;
// if it's 12am, set our hour to 0
if (($hour==12) && ($PM==0)) { $hour=0; }
elseif (($PM==1) && ($hour!=12)) { $hour=$hour+12; }
$minute=substr($time,strpos($time,":")+1,2);
}
// even hour
else
{
$hour=substr($time,0,strpos($time," "))+$hour;
$minute="00";
}
echo "hour=$hour,minute=$minute<br>";
// lets adjust so we can subtract the preshow
$unixshowtime=mktime($hour,$minute,0,$month,$day,$year);
echo "unixshowtime=$unixshowtime<br>";
$unixshowtime=$unixshowtime-(60*$preshow);
$datearray=getdate($unixshowtime);
$hour=$datearray['hours'];
$minute=$datearray['minutes'];
$day=$datearray['mday'];
$month=$datearray['mon'];
$year=$datearray['year'];
}
}
if ($title)
{
fwrite($writehandle,"\n");
fwrite($writehandle,"$_H[1]$newregkey]\n");
fwrite($writehandle,$_Name);
fwrite($writehandle,$showname . "_" . $title . "\"\n");
fwrite($writehandle,$_On . "\n" . $_Every . "\n");
fwrite($writehandle,$_Date . $day ."/" . $month . "/" . $year . "\"\n");
fwrite($writehandle,$_Time . $hour . ":" . $minute . "\"\n");
fwrite($writehandle,$_Active . "\n" . $_Duration . "\n" . $_Feature . "\n\n");
fwrite($writehandle,$_H[2] . $newregkey . "\\Capture]" . "\n" . $_Quality . "\n");
fwrite($writehandle,$_Pattern_ID . "\n" . str_replace("\\","\\\\",$_Path) . "\"\n\n");
fwrite($writehandle,$_H[3] . $newregkey . "\\Capture\\Pattern Data]\n");
fwrite($writehandle,$_Custom . "\"" . str_replace(" ","",$showname) . "_");
fwrite($writehandle,str_replace(" ","",$title) . "\"\n\n");
fwrite($writehandle,$_H[4] . $newregkey . "\\Tuner]\n" . $_Channel);
$truechannel=dechex($channel);
$numzeros=8-strlen($truechannel);
for($thelen=1;$thelen<=$numzeros;$thelen++)
{
fwrite($writehandle,"0");
}
fwrite($writehandle,$truechannel . "\n\n");
fwrite($writehandle,$_H[5] . $newregkey . "\\Video]\n\n");
fwrite($writehandle,$_H[6] . $newregkey . "\\Video\\Analog Tv Tuner]\n");
fwrite($writehandle,$_ID . "\n" . $_Standard . "\n" . $_NoiseReduction . "\n");
fwrite($writehandle,$_Fields . "\n" . $_Color . "\n" . $_Tint . "\n");
fwrite($writehandle,$_Bright . "\n" . $_Contract . "\n" . $_Temperature . "\n");
$title="";
$newregkey++;
}
}
}
echo "</pre>END";
?>
Robstarusa
14th February 2003, 16:37
But I'm missing something with recording things at 12am (midnight). It seems that if I subtract one minute, and look at the time, it's 11:59am, argh.
Rob
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.