[mythtv-users] tv_grab_au script from this list. Anyone elsehadproblems today?

Nick Tan nick at wehi.EDU.AU
Tue Aug 2 11:26:10 UTC 2005



> Berry, David wrote:
>
>>Same here (Canberra)
>>
>>How do we fix it? - change the script?
>>
>>
>>
> I had a poke around and the changes seem to be they changed the url from
> /closeup/ to /cu/ and changed a couple of the attributes that are
> searched for the find the programs id to find its close up details. The
> url changes are pretty simple and only exist in a couple of places
> however I don't know anywhere enough, well no, perl to change the
> regular expressions to filter out the right program info.
>
> It seems it's either fixing this all the time or going back to d1 (I
> only ever got program data for SBS News here in Canberra, never played
> with it much) or paying $150 a year with IceTV.

I think I've fixed it (it works with my setup anyways)

As you've said they've changed /closeup/ to /cu/ but they've also changed
how the pids are displayed.

Changes at around line 350 of the script:

if ($link =~ /cu\/default.asp/)
        {
        my $rowspan = $link;
        $rowspan =~ s/.+rowspan=//g;
        $rowspan =~ s/ .+//g;

        my $name = $link;
        #$name =~ s/.+target=new>(<P>|)//g;
        $name =~ s/.+target=_new class=tv>//g;
        $name =~ s/<\/a>.+//g;
        if ($name =~ /\]/) {
                my @nameline=split/\]/,$name;
                $name = $nameline[1];
                $name =~ s/^ //g;
        }
        my $linktemp = $link;
        $link =~ s/.+pid=//g;
        $link =~ s/".+//g; #"
        my @linksplit=split/&/,$link;
        #$link = $linksplit[0];
        my @linksplit2=split/ /,$linksplit[0];
        $link = $linksplit2[0];
        chomp($link);
        chomp($rowspan);
        chomp($name);


also change the fetch_details subroutine to be:

sub fetch_details
{
        my $datepid=$datepids->dequeue;
        my @datepidl=split /-/, $datepid;
        my $date = $datepidl[0];
        my $pidtemp = $datepidl[1];
        my @pidsplit=split /&/, $pidtemp;
        my $pid = $pidsplit[0];

        while (($date!=0) and ($pid!=0))
        {
                my $guide_dir = $cache_dir . "/" . $date;
                mkpath ($guide_dir);

                my $url = $details_url . $pid;
                my $details_file = $guide_dir . "/" . $pid . ".html";

                for (my $retry=0; is_error(getstore($url, $details_file))
&& ($retry<$retrys); $retry++)
                {
                        sleep($seconds_before_retry);
                }

                $datepid=$datepids->dequeue;
                @datepidl=split /-/, $datepid;
                $date = $datepidl[0];
        #       $pid = $datepidl[1];
                my $pidtemp = $datepidl[1];
                my @pidsplit=split /&/, $pidtemp;
                my $pid = $pidsplit[0];
        }
}




Like I said, this works for me, YMMV.  But it should be a good starting
point for anyone who wants to clean it up a bit :)



More information about the mythtv-users mailing list