[mythtv-users] New Australian XMLTV grabber

Paul Andreassen paulx at andreassen.com.au
Sun Dec 12 14:55:52 UTC 2004


On Sun, 2004-12-12 at 20:27, Rob Hillis wrote:
> After far too long, I've changed over to this posted version of the
> script

Excellent.

>  - it's working fine for the freesd channels, but when I run an
> appropriately modified copy for Foxtel, I end up with the following...
>         mythtv root # tv_grab_au_foxtel
>         grabing 7 days into /var/local/tv_grab_au_foxtel/guide.xml
>         starting 5 threads
>         loading queue
>         11122004 unchanged
>         12122004 unchanged
>         13122004 unchanged
>         14122004 unchanged
>         15122004 unchanged
>         16122004 downloading
>         Use of uninitialized value in string at
>         /usr/bin/tv_grab_au_foxtel line 722.

This is probably caused by have no data to download.

>         17122004 downloading
>         Use of uninitialized value in string at
>         /usr/bin/tv_grab_au_foxtel line 722.
>         18122004 downloading
>         Use of uninitialized value in string at
>         /usr/bin/tv_grab_au_foxtel line 722.
>         queue is complete
>         all threads done
>         building xml structure
> At this point, the script just hangs.  

The hang is probably because the files aren't closed and then can't be
opened.

> Doesn't do anything, even if left alone for a few hours.  I probably
> should point out that the Foxtel channels aren't in my channels table
> (yet) though I doubt this is the cause of the problem.  A diff between
> the two scripts yeilds the following...
> 
> mythtv bin # diff -u tv_grab_au tv_grab_au_foxtel
> --- tv_grab_au  2004-12-12 18:58:37.059979392 +1100
> +++ tv_grab_au_foxtel   2004-12-12 19:01:11.487502840 +1100
> @@ -115,15 +115,15 @@
>  #my $location = "Brisbane";
>  #my $location = "Queensland";
>  #my $location = "Sydney";
> -my $location = "Melbourne";
> -#my $location = "Australia";
> +#my $location = "Melbourne";
> +my $location = "Australia";
> 
>  # pick your source
>  #
>  #my $source = "free";
> -my $source = "freesd";
> +#my $source = "freesd";
>  #my $source = "freehd";
> -#my $source = "foxtel";
> +my $source = "foxtel";
> 
>  # choose the XMLID URL suffix that mythtv knows
>  #
> @@ -144,7 +144,7 @@
> 
>  my $guide_url = "http://tvguide.ninemsn.com.au/guide/";
>  my $details_url =
> "http://tvguide.ninemsn.com.au/closeup/default.asp?pid=";
> -my $cache_dir = "/var/local/tv_grab_au";
> +my $cache_dir = "/var/local/tv_grab_au_foxtel";
> 
>  my $XMLTV_prefix = $source . "." . $location . ".";
>  my $XMLTV_suffix = "." . $XMLTVID_URL;
> 

Look good to me.

> I haven't seen anything else that should need to be reconfigured. 
> Just in case there's an extra couple of linefeeds in my script, line
> 722 is the following one that is in bold.  It's in the last function
> of the script.
> 
>         if (open(PRN, ">", $guide_prn_file))
>         {
>                 for (my $count=0; $count<$#pidsrowspansnames;
> $count++) {
>                         print PRN "$pidsrowspansnames[$count]>";
>                 }
>                 print PRN "$pidsrowspansnames[$#pidsrowspansnames]";

I believe this is the line giving grieve.

>                 close(PRN);
>         } else {
>                 print "can't open for writing $guide_prn_file\n";
>         }
> 
> I am as sure as I can be that I have copied the script verbatim.  My
> knowledge of PERL is near zero, though I know enough C/C++ to be able
> to make some sense of the code.

Read the 'man perlintro' and you should be ok.

>   That line does look a little odd, though I'd be willing to bet the
> difference between $pids.. and $#pids is like the difference between a
> variable and a pointer, so I may well be wrong.

Perl is much more convoluted than that. 

> Is anyone else running in to this?  Is it just me?

Not may people use the foxtel stuff.

I've attached a fixed version and here is a test output:

grabing 1 days into /var/local/tv_grab_au.foxtel/guide.xml
starting 5 threads
loading queue
18122004 downloading
19122004 downloading
queue is complete
all threads done
building xml structure
no pids in /var/local/tv_grab_au.foxtel/18122004/guide.prn
no pids in /var/local/tv_grab_au.foxtel/19122004/guide.prn
writing file
cleaning 7 days
done

Paul

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tv_grab_au
Type: text/x-perl
Size: 19913 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20041213/dfe4a3bd/tv_grab_au.pm


More information about the mythtv-users mailing list