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

David Collett david.collett at gmail.com
Tue Aug 2 11:42:16 UTC 2005


Hi,
To all of those who have never actually tried the MSN grabber. It
really is great. Very complete, consistent and reliable. The data
comes from HWW who also supply to most other online tv guides (yahoo,
seven, yourtv, etc). It is therefore essentially the definitive source
of oz guide data. It doesnt get any better than that.

The problem of course is that MSN could change the html any time they
like. But as far as I am concerned, if we have to fix it from time to
time, so be it, It's not that hard. Then there is the potential legal
issues (if any), but until someone starts threatening people, let's
not worry about that :)

Dave

On 8/2/05, Nick Tan <nick at wehi.edu.au> wrote:
> 
> 
> > 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 :)
> 
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>


More information about the mythtv-users mailing list