Re: [mythtv-users] tv_grab_au v1.31

2005-08-08 Thread Andy Foster
On 8/8/05, Jon Whitear [EMAIL PROTECTED] wrote:
 On another note (and borrowing from another thread) I would find it useful
 to be able to populate two channel's data from one source e.g. ABC TV and
 ABC HDTV, both from ABC TV.

Possibly I am misunderstanding, but you should be able to do this with
the new duplicates feature. Or possibly even by just using the same
xmltvid.
___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


Re: [mythtv-users] tv_grab_au v1.31

2005-08-07 Thread Andy Foster
Hey,

I thought I'd give 1.32 a go as whatever the other script I'm using
hasn't worked for a week (I've long since given up trying to keep
track of what's out there :), so I generated a config file for
Brisbane, and it works fine with slow = 0. However with slow 1 (after
deleting the cached.pl made with slow=0, or it will ignore the new
slow=1 directive - not sure if this is intentional behaviour but it
baffled me for a bit), the script spits out a stack of:

[EMAIL PROTECTED] .xmltv $ ./tv_grab_au
grabbing 5 days into /tmp/tv_grab_au/guide.xml
Use of uninitialized value in split at ./tv_grab_au line 440,  line 1.
Use of uninitialized value in string eq at ./tv_grab_au line 444,  line 1.
channel mismatch for 'Jay Jay the Jet Plane' (pid = 12449372)
Exiting subroutine via next at ./tv_grab_au line 447,  line 1.
Use of uninitialized value in split at ./tv_grab_au line 440,  line 1.
Use of uninitialized value in string eq at ./tv_grab_au line 444,  line 1.
channel mismatch for 'Rage' (pid = 12396671)

I tried looking at the code but I'm not familiar with perl at all so
all I saw was the matrix.. The contents of @td seems to be malformed
however:
- Fire Engine Evan/Tracy's Candy Catastrophe ~~~ Cartoon ~~~ This
children's program follows the adventures of Jay Jay and his friends
as they take off in search of fun and excitement. ~~~  ~~~

Where ~~~ is my delimeter.

I do recall trying to deal with this problem before, but not getting
anywhere. What might be causing this?



On 8/6/05, Michael Smith [EMAIL PROTECTED] wrote:
 Hi all.
 
 The recent problem with the NMSM website (coinciding with pid changes in
 Canberra?) has prompted an update to my tv_grab_au. The latest version
 is attached and also updated at http://www.immir.com/tv_grab_au.
 
 I've added a (manual) configuration option for program listing
 duplication; for example, with the following lines in the config file:
 
$channels = {
  'ABC ACT' = 'act.abc.gov.au',
  'SBS EASTERN' = 'eastern.sbs.com.au'
};
$duplicate = {
   'act.abc.gov.au' = { 'ABC copy 1'  = 'blah.abc.gov.au',
 'ABC copy 2'  = 'rhubarb.abc.gov.au' },
   'eastern.sbs.com.au' = { 'SBS HD' = 'hd.eastern.sbs.com.au' }
};
 
 will duplicate the program information to new channels with specified
 names and XMLTV channel ids. (As usual, this is simply perl code, so be
 wary of syntax.) The names (eg, 'ABC Copy1') get incorporated into the
 XMLTV channel information; AFAIK these values won't be seen in mythtv at
 all.
 
 Hopefully that's flexible enough for most people. (?)
 
 Also, the details url is extracted from the link on the guide page
 rather than constructed from the pid value; this should prevent problems
 like we all had last week when they change the url format.
 
 Cheers,
 Michael.
 

___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


Re: [mythtv-users] tv_grab_au v1.31

2005-08-07 Thread Michael Smith



[EMAIL PROTECTED] .xmltv $ ./tv_grab_au
grabbing 5 days into /tmp/tv_grab_au/guide.xml
Use of uninitialized value in split at ./tv_grab_au line 440,  line 1.
Use of uninitialized value in string eq at ./tv_grab_au line 444,  line 1.
channel mismatch for 'Jay Jay the Jet Plane' (pid = 12449372)
Exiting subroutine via next at ./tv_grab_au line 447,  line 1.
Use of uninitialized value in split at ./tv_grab_au line 440,  line 1.
Use of uninitialized value in string eq at ./tv_grab_au line 444,  line 1.
channel mismatch for 'Rage' (pid = 12396671)

I tried looking at the code but I'm not familiar with perl at all so
all I saw was the matrix.. The contents of @td seems to be malformed


Interesting. I'm looking into this. I assume the script continues and 
writes a valid xml file at the end (possibly without these two programs?)?


Michael.
___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


Re: [mythtv-users] tv_grab_au v1.31

2005-08-07 Thread Michael Smith

Phill Edwards wrote:


Michael - thanks on behalf of Aussie MythTV users for this script and
for updating it to cope with the recent changes. I've been using your
script for a while and I think it's the best one of the different ones
going around.

Not sure if you saw the discussion last week of getting one of the
Aussie grabbers submitted to be part of the XMLTV package, but there
was a general feeling that your's would be the best to submit. Would
you have an issue with that?


Happy for that to happen, if that's the consensus.

I myself declined from submitting it some time ago when I discovered 
there were some legal issues involved... out of my hands now :-)


Michael.

___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


Re: [mythtv-users] tv_grab_au v1.31

2005-08-07 Thread Matthew Pratt
--- Phill Edwards [EMAIL PROTECTED] wrote:
 Michael - thanks on behalf of Aussie MythTV users
 for this script and
 for updating it to cope with the recent changes.
 I've been using your
 script for a while and I think it's the best one of
 the different ones
 going around.

Seconded. Seems you have been scratching more than
your own itch too. Many thanks Michael.

Matt




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


Re: [mythtv-users] tv_grab_au v1.31

2005-08-07 Thread Jon Whitear

 Seconded. Seems you have been scratching more than
 your own itch too. Many thanks Michael.


And, err, thirded. Thankyou.

 Interesting. I'm looking into this. I assume the script continues and
 writes a valid xml file at the end (possibly without these two
 programs?)?

I'm getting the same thing (with v1.32). The following sequence of errors
occurs, for (I think) every program.

Use of uninitialized value in split at /usr/bin/tv_grab_au line 440.
Use of uninitialized value in string eq at /usr/bin/tv_grab_au line 444.
channel mismatch for 'This is Your Day' (pid = 12469127)
Exiting subroutine via next at /usr/bin/tv_grab_au line 447.
snip
writing xml
tv_grab_au: downloads = 1 guide pages, 242 detail pages
tv_grab_au: finished in 111 seconds


This is only for a --slow grab. Fast ones work fine. The resulting xml
looks like this:-

?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE tv SYSTEM xmltv.dtd

tv source-info-url=http://tvguide.ninemsn.com.au; source-info-name=NMSN
TV Guide generator-info-name=XMLTV - tv_grab_au NMSN v1$
  channel id=nsw.abc.gov.au
display-name lang=enABC NSW/display-name
  /channel
  channel id=abc2.abc.gov.au
display-name lang=enABC2/display-name
  /channel
  channel id=sydney.nine.com.au
display-name lang=enCHANNEL NINE SYDNEY/display-name
  /channel
  channel id=sydney.seven.com.au
display-name lang=enCHANNEL SEVEN SYDNEY/display-name
  /channel
  channel id=sydney.ten.com.au
display-name lang=enNETWORK TEN SYDNEY/display-name
  /channel
  channel id=news.sbs.com.au
display-name lang=enSBS NEWS/display-name
  /channel
  channel id=sydney.sbs.com.au
display-name lang=enSBS SYDNEY/display-name
  /channel
/tv

i.e. there's no program data.

On another note (and borrowing from another thread) I would find it useful
to be able to populate two channel's data from one source e.g. ABC TV and
ABC HDTV, both from ABC TV.

--
Cheers,

Jon

___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


Re: [mythtv-users] tv_grab_au v1.31

2005-08-07 Thread Andy Foster
On 8/8/05, Michael Smith [EMAIL PROTECTED] wrote:
 
  [EMAIL PROTECTED] .xmltv $ ./tv_grab_au
  grabbing 5 days into /tmp/tv_grab_au/guide.xml
  Use of uninitialized value in split at ./tv_grab_au line 440,  line 1.
  Use of uninitialized value in string eq at ./tv_grab_au line 444,  line 1.
  channel mismatch for 'Jay Jay the Jet Plane' (pid = 12449372)
  Exiting subroutine via next at ./tv_grab_au line 447,  line 1.
  Use of uninitialized value in split at ./tv_grab_au line 440,  line 1.
  Use of uninitialized value in string eq at ./tv_grab_au line 444,  line 1.
  channel mismatch for 'Rage' (pid = 12396671)
 
  I tried looking at the code but I'm not familiar with perl at all so
  all I saw was the matrix.. The contents of @td seems to be malformed
 
 Interesting. I'm looking into this. I assume the script continues and
 writes a valid xml file at the end (possibly without these two programs?)?

I should clarify myself. The script actually spits heaps of these
these out endlessly - I assume it's for every single program, so it's
fairly systematic, but I have never actually let it run to completion
so I don't know if it writes a valid file in the end.

I can give it a try when I get home.
___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


[mythtv-users] tv_grab_au v1.31

2005-08-06 Thread Michael Smith

Hi all.

The recent problem with the NMSM website (coinciding with pid changes in 
Canberra?) has prompted an update to my tv_grab_au. The latest version 
is attached and also updated at http://www.immir.com/tv_grab_au.


I've added a (manual) configuration option for program listing 
duplication; for example, with the following lines in the config file:


  $channels = {
'ABC ACT' = 'act.abc.gov.au',
'SBS EASTERN' = 'eastern.sbs.com.au'
  };
  $duplicate = {
 'act.abc.gov.au' = { 'ABC copy 1'  = 'blah.abc.gov.au',
   'ABC copy 2'  = 'rhubarb.abc.gov.au' },
 'eastern.sbs.com.au' = { 'SBS HD' = 'hd.eastern.sbs.com.au' }
  };

will duplicate the program information to new channels with specified 
names and XMLTV channel ids. (As usual, this is simply perl code, so be 
wary of syntax.) The names (eg, 'ABC Copy1') get incorporated into the 
XMLTV channel information; AFAIK these values won't be seen in mythtv at 
all.


Hopefully that's flexible enough for most people. (?)

Also, the details url is extracted from the link on the guide page 
rather than constructed from the pid value; this should prevent problems 
like we all had last week when they change the url format.


Cheers,
Michael.
#!/usr/bin/perl -w

eval 'exec /usr/bin/perl -w -S $0 ${1+$@}'
if 0; # not running under some shell

# ===
# --- new NMSN Australian TV grabber by Michael 'Immir' Smith...
# --- $Id: tv_grab_au,v 1.31 2005/08/06 08:35:21 michael Exp $
#
# A current version of this script should usually be available here:
#
#   http://immir.com/tv_grab_au
#
# pod documentation coming later...
#
# in brief:   --configure   configure the grabber
# --config-file file  use specified config file
# --list-channels   show subscribed channels and xmltvids
# --slowdownload a details page for every show
# --fastopposite of --slow (to override config)
# --days ndays to grab
# --output file   xml output file
# --ignore-cacheignore cached information
#
# When run with mythfilldatabase, the config file may end up as
# ~/.mythtv/tv_grab_au.xmltv and this is where xmltvids for channels can
# be modified.
#
# Listing information can be duplicated for more than one channel id
# using a construction like this (be careful of syntax) in the config file:
#
#$duplicate = {
#   'act.abc.gov.au' = { 'ABC HD'   = 'hd.abc.gov.au',
# 'ABC CHAN 22'  = '22.abc.gov.au' },
#   'eastern.sbs.com.au' = { 'SBS HD' = 'hd.eastern.sbs.com.au' }
#};
#
# Downloading of details pages can be controlled by the --slow option
# (possibly set by default during configuration) and regular expressions
# contained in the following two files (one regexp per line):
#
# ~/.tv_grab_au-detailedcontains a list of regular expressions matching
#   chanid:titles of shows for which we want details
#   e.g.:   Doctor Who
#   Simpsons
#   abc.gov.au:.*Chef
#
# ~/.tv_grab_au-undetailed  regular expressions matching chanid:titles to 
#   skip details downloads
#   e.g.:   News
#   news.sbs.com.au
#
# NB: a match against the detailed list overrides any undetailed matches.
# When changing these files, use the --ignore-cache option to ensure
# all new details are downloaded.
#
# Changes:
#
# (*) TZ change added as suggested by Greg Boundy
# (*) use extracted details url to make it more resilient to site changes
# (*) manual configuration of duplication for channels

use strict;
use Getopt::Long;
use LWP::UserAgent;
use Date::Manip;
use File::Path;
use File::Basename;
use Data::Dumper;
use HTML::TreeBuilder;

use XMLTV;
use XMLTV::Ask;
use XMLTV::ProgressBar;
use XMLTV::Config_file;

# ---
# --- global parameters/constants
my $conf = {};  # ref to hash of configuration parameters
my $channels = {};  # ref to hash of subscribed channel names to xmltvids
my %chanid; # mapping from lowercase channel name to xmltv channel id
my $duplicate = {}; # hashref for channel duplication
# NOTE: conf, channels and duplicate are read in from the config file

my $lang = en;
my $spoofMSID = 1;  # spoof random MSIDs to avoid redirects? big speed up!
my $output_dir = /var/local/tv_grab_au;
my $cache_file = $output_dir/cached.pl;

my $want_details_file = $ENV{HOME}/.tv_grab_au-detailed;
my $skip_details_file = $ENV{HOME}/.tv_grab_au-undetailed;
my (@want_details, @skip_details);

my $count_guide  = 0; # global counter for reporting
my $count_detail = 0; # global counter for reporting

# --- various NMSN site URLs
my $NMSN   = 

RE: [mythtv-users] tv_grab_au v1.31

2005-08-06 Thread Greg Wright
Any idea's as to why I am getting the following error?

Use of uninitialized value in concatenation (.) or string at
/usr/bin/tv_grab_au line 157.
Use of uninitialized value in pattern match (m//) at
/usr/lib/perl5/vendor_perl/5.8.5/Date/Manip.pm line 267.

Using the latest version, 1.31.

Cheers,
Greg 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael Smith
Sent: Saturday, 6 August 2005 6:42 PM
To: Discussion about mythtv
Subject: [mythtv-users] tv_grab_au v1.31

Hi all.

The recent problem with the NMSM website (coinciding with pid changes in
Canberra?) has prompted an update to my tv_grab_au. The latest version
is attached and also updated at http://www.immir.com/tv_grab_au.

I've added a (manual) configuration option for program listing
duplication; for example, with the following lines in the config file:

   $channels = {
 'ABC ACT' = 'act.abc.gov.au',
 'SBS EASTERN' = 'eastern.sbs.com.au'
   };
   $duplicate = {
  'act.abc.gov.au' = { 'ABC copy 1'  = 'blah.abc.gov.au',
'ABC copy 2'  = 'rhubarb.abc.gov.au' },
  'eastern.sbs.com.au' = { 'SBS HD' = 'hd.eastern.sbs.com.au' }
   };

will duplicate the program information to new channels with specified
names and XMLTV channel ids. (As usual, this is simply perl code, so be
wary of syntax.) The names (eg, 'ABC Copy1') get incorporated into the
XMLTV channel information; AFAIK these values won't be seen in mythtv at
all.

Hopefully that's flexible enough for most people. (?)

Also, the details url is extracted from the link on the guide page
rather than constructed from the pid value; this should prevent problems
like we all had last week when they change the url format.

Cheers,
Michael.


___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users