Permalink
Browse files

foxtel_swf: Update for datasource change

  • Loading branch information...
1 parent 90e0a5a commit 167c129a32f183ce788a463701918d8fd29b0f8f max committed Dec 11, 2011
Showing with 140 additions and 140 deletions.
  1. +139 −139 grabbers/foxtel_swf
  2. +1 −1 status
View
278 grabbers/foxtel_swf
@@ -7,7 +7,7 @@
use strict;
my $progname = "foxtel_swf";
-my $version = "2.04";
+my $version = "3.00";
my $cache_file = $progname.".storable.cache";
use XML::Simple;
@@ -383,31 +383,31 @@ sub get_reference_data
my $parsed_xml = XMLin($data);
die "Failed to retrieve valid ReferenceData\n"
- if (!defined $parsed_xml->{'soapenv:Body'}->{'ns1:InitialiseEpgOut'});
- my $ref = $parsed_xml->{'soapenv:Body'}->{'ns1:InitialiseEpgOut'};
+ if (!defined $parsed_xml->{'soapenv:Body'}->{'ns5:InitialiseEpgOut'});
+ my $ref = $parsed_xml->{'soapenv:Body'}->{'ns5:InitialiseEpgOut'};
# check for error response
- die "ReferenceData page indicated failure code: ".$ref->{'ns1:EPGFault'}->{'ns1:Message'}.": aborting!\n"
- if ($ref->{'ns1:EPGFault'}->{'ns1:Message'});
+ die "ReferenceData page indicated failure code: ".$ref->{'ns5:EPGFault'}->{'ns5:Message'}.": aborting!\n"
+ if ($ref->{'ns5:EPGFault'}->{'ns5:Message'});
# get bouqet
die "Failed to retrieve Bouquet\n"
- if (!defined $ref->{'ns1:Bouquet'});
- $d->{bouquet}->{bouquet_id} = $ref->{'ns1:Bouquet'}->{'ns1:BouquetId'};
- $d->{bouquet}->{subbouquet_id} = $ref->{'ns1:Bouquet'}->{'ns1:SubBouquetId'};
+ if (!defined $ref->{'ns5:Bouquet'});
+ $d->{bouquet}->{bouquet_id} = $ref->{'ns5:Bouquet'}->{'ns5:BouquetId'};
+ $d->{bouquet}->{subbouquet_id} = $ref->{'ns5:Bouquet'}->{'ns5:SubBouquetId'};
# get state
die "Failed to retrieve State\n"
- if (!defined $ref->{'ns1:State'});
- $d->{state}->{id} = $ref->{'ns1:State'}->{'ns1:Id'};
- $d->{state}->{code} = $ref->{'ns1:State'}->{'ns1:Code'};
- $d->{state}->{name} = $ref->{'ns1:State'}->{'ns1:Name'};
+ if (!defined $ref->{'ns5:State'});
+ $d->{state}->{id} = $ref->{'ns5:State'}->{'ns5:Id'};
+ $d->{state}->{code} = $ref->{'ns5:State'}->{'ns5:Code'};
+ $d->{state}->{name} = $ref->{'ns5:State'}->{'ns5:Name'};
Shepherd::Common::log(" - parsed state id:$d->{state}->{id}, code:$d->{state}->{code}, bouquet_id:$d->{bouquet}->{bouquet_id}, subbouquet_id:$d->{bouquet}->{subbouquet_id}, name:$d->{state}->{name}") if (defined $opt->{debug});
# gather up channel categories
- foreach my $category_ref (@{($ref->{'ns1:ChannelCategories'}->{'ns1:Category'})}) {
- my $category_id = $category_ref->{'ns1:Id'};
- my $category_name = $category_ref->{'ns1:Name'};
+ foreach my $category_ref (@{($ref->{'ns5:ChannelCategories'}->{'ns5:Category'})}) {
+ my $category_id = $category_ref->{'ns5:Id'};
+ my $category_name = $category_ref->{'ns5:Name'};
$d->{categories}->{$category_id} = $category_name;
Shepherd::Common::log(" - parsed category $category_id: $category_name") if (defined $opt->{debug});
@@ -416,17 +416,17 @@ sub get_reference_data
# gather up genres and subgenres
$d->{genre_count} = 0;
$d->{subgenre_count} = 0;
- foreach my $genre_ref (@{($ref->{'ns1:Genres'}->{'ns1:Genre'})}) {
- my $genre_code = $genre_ref->{'ns1:Code'};
- my $genre_name = $genre_ref->{'ns1:Name'};
+ foreach my $genre_ref (@{($ref->{'ns5:Genres'}->{'ns5:Genre'})}) {
+ my $genre_code = $genre_ref->{'ns5:Code'};
+ my $genre_name = $genre_ref->{'ns5:Name'};
$d->{genres}->{$genre_code}->{name} = $genre_name;
$d->{genre_count}++;
- foreach my $subgenre_ref (@{($genre_ref->{'ns1:SubGenre'})}) {
- # GetEventDetails returns ns1:SubGenreCode Id, not Code, so we store the Id
- my $subgenre_code = $subgenre_ref->{'ns1:Id'};
- my $subgenre_name = $subgenre_ref->{'ns1:Name'};
+ foreach my $subgenre_ref (@{($genre_ref->{'ns5:SubGenre'})}) {
+ # GetEventDetails returns ns5:SubGenreCode Id, not Code, so we store the Id
+ my $subgenre_code = $subgenre_ref->{'ns5:Id'};
+ my $subgenre_name = $subgenre_ref->{'ns5:Name'};
$d->{genres}->{$genre_code}->{$subgenre_code} = $subgenre_name;
$d->{subgenre_count}++;
@@ -438,21 +438,21 @@ sub get_reference_data
# gather up channels
$d->{channel_count} = 0;
- foreach my $channel_ref (@{($ref->{'ns1:Channels'}->{'ns1:Channel'})}) {
- my $channel_id = $channel_ref->{'ns1:Id'};
- my $channel_name = $channel_ref->{'ns1:ChannelName'};
+ foreach my $channel_ref (@{($ref->{'ns5:Channels'}->{'ns5:Channel'})}) {
+ my $channel_id = $channel_ref->{'ns5:Id'};
+ my $channel_name = $channel_ref->{'ns5:ChannelName'};
my $orig_channel_name = $channel_name;
$channel_name =~ s/[ \t()\[\]\+\.\-]//g; # remove special chars
$channel_name =~ s/(&|&)/and/g; # & to and
$channel_name =~ s|[/,].*||; # and deleting after / or ,
$d->{channel_names}->{$channel_name} = $channel_id;
$d->{channels}->{$channel_id}->{name} = $orig_channel_name;
- $d->{channels}->{$channel_id}->{number} = $channel_ref->{'ns1:DigitalNumber'};
- $d->{channels}->{$channel_id}->{category} = $channel_ref->{'ns1:ChannelCategoryId'};
- $d->{channels}->{$channel_id}->{content_warning} = $channel_ref->{'ns1:ContentWarningInd'};
- $d->{channels}->{$channel_id}->{available} = $channel_ref->{'ns1:ChannelAvailableInd'};
- $d->{channels}->{$channel_id}->{timeshift} = $channel_ref->{'ns1:TimeShiftInd'};
+ $d->{channels}->{$channel_id}->{number} = $channel_ref->{'ns5:DigitalNumber'};
+ $d->{channels}->{$channel_id}->{category} = $channel_ref->{'ns5:ChannelCategoryId'};
+ $d->{channels}->{$channel_id}->{content_warning} = $channel_ref->{'ns5:ContentWarningInd'};
+ $d->{channels}->{$channel_id}->{available} = $channel_ref->{'ns5:ChannelAvailableInd'};
+ $d->{channels}->{$channel_id}->{timeshift} = $channel_ref->{'ns5:TimeShiftInd'};
$d->{channel_count}++;
Shepherd::Common::log(" - parsed channel $channel_id: (".$d->{channels}->{$channel_id}->{number}.") $channel_name)") if (defined $opt->{debug});
@@ -548,7 +548,7 @@ sub get_programs
# print "Local Start time: ".localtime( $starttime). "Stop: ".localtime( $stoptime)."\n" ;
$ref = &soap_search_events($starttime, $stoptime);
return 1 if (! defined($ref));
- Shepherd::Common::log(" gathering synopsis for up to ".(scalar(@{($ref->{'ns1:Events'}->{'ns1:Event'})}))." progs ...");
+ Shepherd::Common::log(" gathering synopsis for up to ".(scalar(@{($ref->{'ns5:Events'}->{'ns5:Event'})}))." progs ...");
#
# Loop through each programme and see if we have it in the cache. If it's in the cache grab it and write it to the output file.
@@ -560,20 +560,20 @@ sub get_programs
my $cache_miss = 0;
my @event_list;
- foreach my $prog_ref (@{($ref->{'ns1:Events'}->{'ns1:Event'})}) {
+ foreach my $prog_ref (@{($ref->{'ns5:Events'}->{'ns5:Event'})}) {
$prog_count++;
### first check the program start, stop and durations (new_start & new_stop are used to overide the cache entry
my $new_start = 0;
my $new_stop = 0;
my $new_channel = "none";
- my $new_length = int($prog_ref->{'ns1:Duration'} * 60);
+ my $new_length = int($prog_ref->{'ns5:Duration'} * 60);
my $new_title;
- $new_title = $prog_ref->{'ns1:ProgramTitle'} if (defined $prog_ref->{'ns1:ProgramTitle'});
+ $new_title = $prog_ref->{'ns5:ProgramTitle'} if (defined $prog_ref->{'ns5:ProgramTitle'});
- if ((defined $prog_ref->{'ns1:ScheduledDate'}) &&
- ($prog_ref->{'ns1:ScheduledDate'} =~ /^(\d{4})-(\d{2})\-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d{3})\+(\d{2}):(\d{2})$/)) {
+ if ((defined $prog_ref->{'ns5:ScheduledDate'}) &&
+ ($prog_ref->{'ns5:ScheduledDate'} =~ /^(\d{4})-(\d{2})\-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d{3})\+(\d{2}):(\d{2})$/)) {
my $prog_tz = "+".$8.$9;
my @t = ($6, $5, $4, $3, ($2-1), ($1-1900), -1, -1, -1);
@@ -583,20 +583,20 @@ sub get_programs
$new_start = POSIX::strftime("%Y%m%d%H%M%S", localtime($prog_start))." ".$prog_tz;
$new_stop = POSIX::strftime("%Y%m%d%H%M%S", localtime($prog_stop))." ".$prog_tz;
if ((defined $opt->{daynum}) and ( $prog_start < $first_start_time ))
- { print("Skipping, starts before requested time at $prog_ref->{'ns1:ScheduledDate'}\n"); next; }
+ { print("Skipping, starts before requested time at $prog_ref->{'ns5:ScheduledDate'}\n"); next; }
} else {
$stats{skipped_prog_bad_starttime}++;
- Shepherd::Common::log("unparsable date ".$prog_ref->{'ns1:ScheduledDate'})
- if ((defined $prog_ref->{'ns1:ScheduledDate'}) &&
+ Shepherd::Common::log("unparsable date ".$prog_ref->{'ns5:ScheduledDate'})
+ if ((defined $prog_ref->{'ns5:ScheduledDate'}) &&
($stats{skipped_prog_bad_starttime} < 10));
next;
}
### and its on the same channel (new_channl is used as a cache key
- if ((defined $prog_ref->{'ns1:ChannelId'}) &&
- (defined $d->{channels}->{$prog_ref->{'ns1:ChannelId'}}->{xmlid})) {
- $new_channel = $d->{channels}->{$prog_ref->{'ns1:ChannelId'}}->{xmlid};
+ if ((defined $prog_ref->{'ns5:ChannelId'}) &&
+ (defined $d->{channels}->{$prog_ref->{'ns5:ChannelId'}}->{xmlid})) {
+ $new_channel = $d->{channels}->{$prog_ref->{'ns5:ChannelId'}}->{xmlid};
} else {
$stats{skipped_prog_bad_channel}++;
next;
@@ -606,10 +606,10 @@ sub get_programs
### now check the program cache for a;; other details....
# if we have a ProgramId...
- if (defined $prog_ref->{'ns1:ProgramId'}) {
- my $prog_id = $new_channel . $prog_ref->{'ns1:ProgramId'};
+ if (defined $prog_ref->{'ns5:ProgramId'}) {
+ my $prog_id = $new_channel . $prog_ref->{'ns5:ProgramId'};
# check the cache
- # print ("Checking prog cache for $prog_id.... ($prog_ref->{'ns1:ProgramTitle'})\n");
+ # print ("Checking prog cache for $prog_id.... ($prog_ref->{'ns5:ProgramTitle'})\n");
if ((defined $data_cache->{prog_cache}->{$prog_id}) && (ref $data_cache->{prog_cache}->{$prog_id}->{details})) {
$cache_hit++;
$stats{programmes}++;
@@ -629,7 +629,7 @@ sub get_programs
$eptitle = $data_cache->{prog_cache}->{$prog_id}->{eptitle} if (defined $data_cache->{prog_cache}->{$prog_id}->{eptitle});
# print (" Found cache Progm for $prog_id ($new_title) [$eptitle] \n");
- Shepherd::Common::log("DEBUG: Found cache Program for ".$prog_id ."... (".($prog_ref->{'ns1:ProgramTitle'}).")") if (defined $opt->{debug}) ;
+ Shepherd::Common::log("DEBUG: Found cache Program for ".$prog_id ."... (".($prog_ref->{'ns5:ProgramTitle'}).")") if (defined $opt->{debug}) ;
Shepherd::Common::log("DEBUG: PCache: ".Dumper($hghghgh)) if ((defined $opt->{debug}) && ($opt->{debug} > 1));
next;
@@ -639,9 +639,9 @@ sub get_programs
### now check the event cache for other details....
# if we have an EventID ... (must be one!)
- my $event_id = $new_channel . $prog_ref->{'ns1:EventId'};
+ my $event_id = $new_channel . $prog_ref->{'ns5:EventId'};
- # print ("Checking event cache for $event_id.... ($prog_ref->{'ns1:ProgramTitle'})\n");
+ # print ("Checking event cache for $event_id.... ($prog_ref->{'ns5:ProgramTitle'})\n");
if ((defined $data_cache->{event_cache}->{$event_id}) && (ref $data_cache->{event_cache}->{$event_id}->{details})) {
$event_hit++;
@@ -659,15 +659,15 @@ sub get_programs
$eptitle = $data_cache->{event_cache}->{$event_id}->{eptitle} if (defined $data_cache->{event_cache}->{$event_id}->{eptitle}) ;
# print (" Found cache Event for $event_id ($new_title) [$eptitle] \n");
- Shepherd::Common::log("DEBUG: Found cache Event entry for ".$event_id."... (".($prog_ref->{'ns1:ProgramTitle'}).")") if (defined $opt->{debug}) ;
+ Shepherd::Common::log("DEBUG: Found cache Event entry for ".$event_id."... (".($prog_ref->{'ns5:ProgramTitle'}).")") if (defined $opt->{debug}) ;
Shepherd::Common::log("DEBUG: ECach: ".Dumper($hghghgh)) if ((defined $opt->{debug}) && ($opt->{debug} > 1));
next;
}
$cache_miss++;
- # print (" Pushing event $prog_ref->{'ns1:EventId'} for lookup\n");
- push(@event_list, $prog_ref->{'ns1:EventId'});
+ # print (" Pushing event $prog_ref->{'ns5:EventId'} for lookup\n");
+ push(@event_list, $prog_ref->{'ns5:EventId'});
} ### foreach my $prog_ref
if ( $cache_miss == 0) {
@@ -680,24 +680,24 @@ sub get_programs
# now retrieve the details for every programme that wasn't in the cache
#
$ref = &soap_get_event_details(@event_list);
- foreach my $prog_ref (@{($ref->{'ns1:EventDetail'})}) {
+ foreach my $prog_ref (@{($ref->{'ns5:EventDetail'})}) {
my $prog;
- $prog->{title} = [[ $prog_ref->{'ns1:ProgramTitle'}, $opt->{lang} ]];
+ $prog->{title} = [[ $prog_ref->{'ns5:ProgramTitle'}, $opt->{lang} ]];
if ($prog->{title}->[0]->[0] =~ s/\s*(?:S(\d+)\s*)?Ep(\d+)(?:\s*&(?:amp;)?\s*\d+$)?//i) { # "S1 Ep5 &amp; 6"
my $xmltv_ns = ($1 ? ($1 - 1) : "") ." . ". ($2 ? ($2 - 1) : "") ." . "; # drops " & 6"
$prog->{'episode-num'} = [[ $xmltv_ns, 'xmltv_ns' ]];
#<title lang="en">Brotherhood S1 Ep5 &amp; 6</title>
}
- $prog->{length} = int($prog_ref->{'ns1:Duration'} * 60);
+ $prog->{length} = int($prog_ref->{'ns5:Duration'} * 60);
- if (!defined $prog_ref->{'ns1:Duration'}) {
+ if (!defined $prog_ref->{'ns5:Duration'}) {
$stats{skipped_prog_no_duration}++;
next;
}
- if ((defined $prog_ref->{'ns1:ScheduledDate'}) &&
- ($prog_ref->{'ns1:ScheduledDate'} =~ /^(\d{4})-(\d{2})\-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d{3})\+(\d{2}):(\d{2})$/)) {
+ if ((defined $prog_ref->{'ns5:ScheduledDate'}) &&
+ ($prog_ref->{'ns5:ScheduledDate'} =~ /^(\d{4})-(\d{2})\-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d{3})\+(\d{2}):(\d{2})$/)) {
my $prog_tz = "+".$8.$9;
my @t = ($6, $5, $4, $3, ($2-1), ($1-1900), -1, -1, -1);
@@ -708,24 +708,24 @@ sub get_programs
$prog->{stop} = POSIX::strftime("%Y%m%d%H%M%S", localtime($prog_stop))." ".$prog_tz;
} else {
$stats{skipped_prog_bad_starttime}++;
- Shepherd::Common::log("unparsable date ".$prog_ref->{'ns1:ScheduledDate'})
- if ((defined $prog_ref->{'ns1:ScheduledDate'}) &&
+ Shepherd::Common::log("unparsable date ".$prog_ref->{'ns5:ScheduledDate'})
+ if ((defined $prog_ref->{'ns5:ScheduledDate'}) &&
($stats{skipped_prog_bad_starttime} < 10));
next;
}
- if ((defined $prog_ref->{'ns1:ChannelId'}) &&
- (defined $d->{channels}->{$prog_ref->{'ns1:ChannelId'}}->{xmlid})) {
- $prog->{channel} = $d->{channels}->{$prog_ref->{'ns1:ChannelId'}}->{xmlid};
+ if ((defined $prog_ref->{'ns5:ChannelId'}) &&
+ (defined $d->{channels}->{$prog_ref->{'ns5:ChannelId'}}->{xmlid})) {
+ $prog->{channel} = $d->{channels}->{$prog_ref->{'ns5:ChannelId'}}->{xmlid};
} else {
$stats{skipped_prog_bad_channel}++;
next;
}
- if ((defined $prog_ref->{'ns1:EpisodeTitle'}) &&
- (ref $prog_ref->{'ns1:EpisodeTitle'} ne "HASH") &&
- ($prog_ref->{'ns1:EpisodeTitle'} ne "")) {
- $prog->{'sub-title'} = [[ $prog_ref->{'ns1:EpisodeTitle'}, $opt->{lang} ]];
+ if ((defined $prog_ref->{'ns5:EpisodeTitle'}) &&
+ (ref $prog_ref->{'ns5:EpisodeTitle'} ne "HASH") &&
+ ($prog_ref->{'ns5:EpisodeTitle'} ne "")) {
+ $prog->{'sub-title'} = [[ $prog_ref->{'ns5:EpisodeTitle'}, $opt->{lang} ]];
if ($prog->{'sub-title'}->[0]->[0] =~ /(?:Series\s*(\d+),\s*)?Episode\s*(\d+)/i) { # "Series 2, Episode 19"
my $xmltv_ns = ($1 ? ($1 - 1) : "") ." . ". ($2 ? ($2 - 1) : "") ." . ";
$prog->{'episode-num'} = [[ $xmltv_ns, 'xmltv_ns' ]];
@@ -735,73 +735,73 @@ sub get_programs
# Program rating and consumer advice
- if ($prog_ref->{'ns1:ParentalRating'} ne "-") {
- if (defined $prog_ref->{'ns1:ConsumerAdvice'}) {
- my $advice = $prog_ref->{'ns1:ConsumerAdvice'};
+ if ($prog_ref->{'ns5:ParentalRating'} ne "-") {
+ if (defined $prog_ref->{'ns5:ConsumerAdvice'}) {
+ my $advice = $prog_ref->{'ns5:ConsumerAdvice'};
$advice =~ s/\s//g;
- $prog->{rating} = [[ $prog_ref->{'ns1:ParentalRating'}." ".$advice, 'ABA', undef ]] ;
+ $prog->{rating} = [[ $prog_ref->{'ns5:ParentalRating'}." ".$advice, 'ABA', undef ]] ;
}
else {
- $prog->{rating} = [[ $prog_ref->{'ns1:ParentalRating'}, 'ABA', undef ]] ;
+ $prog->{rating} = [[ $prog_ref->{'ns5:ParentalRating'}, 'ABA', undef ]] ;
}
}
$prog->{subtitles} = [ { 'type' => 'teletext' } ]
- if (((defined $prog_ref->{'ns1:SubtitledInd'}) && ($prog_ref->{'ns1:SubtitledInd'} ne "false")) ||
- ((defined $prog_ref->{'ns1:ClosedCaptionInd'}) && ($prog_ref->{'ns1:ClosedCaptionInd'} ne "false")));
+ if (((defined $prog_ref->{'ns5:SubtitledInd'}) && ($prog_ref->{'ns5:SubtitledInd'} ne "false")) ||
+ ((defined $prog_ref->{'ns5:ClosedCaptionInd'}) && ($prog_ref->{'ns5:ClosedCaptionInd'} ne "false")));
$prog->{video}->{aspect} = "16:9"
- if ((defined $prog_ref->{'ns1:WidescreenInd'}) && ($prog_ref->{'ns1:WidescreenInd'} ne "false"));
+ if ((defined $prog_ref->{'ns5:WidescreenInd'}) && ($prog_ref->{'ns5:WidescreenInd'} ne "false"));
$prog->{video}->{quality} = "HDTV"
- if (defined $prog_ref->{'ns1:HDInd'} && ($prog_ref->{'ns1:HDInd'} ne "false"));
+ if (defined $prog_ref->{'ns5:HDInd'} && ($prog_ref->{'ns5:HDInd'} ne "false"));
- if (defined $prog_ref->{'ns1:Audio'}) {
+ if (defined $prog_ref->{'ns5:Audio'}) {
# try to match bad values like 'dolby stereo'
- $prog->{audio}->{stereo} = 'mono' if ($prog_ref->{'ns1:Audio'} =~ m/mono/i);
- $prog->{audio}->{stereo} = 'stereo' if ($prog_ref->{'ns1:Audio'} =~ m/stereo/i);
- $prog->{audio}->{stereo} = 'dolby' if ($prog_ref->{'ns1:Audio'} =~ m/dolby/i);
- $prog->{audio}->{stereo} = 'dolby digital' if ($prog_ref->{'ns1:Audio'} =~ m/digital/i);
- $prog->{audio}->{stereo} = 'surround' if ($prog_ref->{'ns1:Audio'} =~ m/surround/i);
+ $prog->{audio}->{stereo} = 'mono' if ($prog_ref->{'ns5:Audio'} =~ m/mono/i);
+ $prog->{audio}->{stereo} = 'stereo' if ($prog_ref->{'ns5:Audio'} =~ m/stereo/i);
+ $prog->{audio}->{stereo} = 'dolby' if ($prog_ref->{'ns5:Audio'} =~ m/dolby/i);
+ $prog->{audio}->{stereo} = 'dolby digital' if ($prog_ref->{'ns5:Audio'} =~ m/digital/i);
+ $prog->{audio}->{stereo} = 'surround' if ($prog_ref->{'ns5:Audio'} =~ m/surround/i);
}
# get actors, directors and writers
- foreach my $actor (@{$prog_ref->{'ns1:Actor'}}) { push(@{($prog->{credits}->{actor})}, $actor); }
- foreach my $director (@{$prog_ref->{'ns1:Director'}}) { push(@{($prog->{credits}->{director})}, $director); }
- foreach my $writer (@{$prog_ref->{'ns1:Writer'}}) { push(@{($prog->{credits}->{writer})}, $writer); }
+ foreach my $actor (@{$prog_ref->{'ns5:Actor'}}) { push(@{($prog->{credits}->{actor})}, $actor); }
+ foreach my $director (@{$prog_ref->{'ns5:Director'}}) { push(@{($prog->{credits}->{director})}, $director); }
+ foreach my $writer (@{$prog_ref->{'ns5:Writer'}}) { push(@{($prog->{credits}->{writer})}, $writer); }
# get description/synopsis
- $prog->{desc} = [[ $prog_ref->{'ns1:ExtendedSynopsis'}, $opt->{lang} ]] if (defined $prog_ref->{'ns1:ExtendedSynopsis'});
+ $prog->{desc} = [[ $prog_ref->{'ns5:ExtendedSynopsis'}, $opt->{lang} ]] if (defined $prog_ref->{'ns5:ExtendedSynopsis'});
# TODO: get series and episode number
-# my $series_num = (defined $prog_ref->{'ns1:SeriesNumber'}) ? $prog_ref->{'ns1:SeriesNumber'} : "";
-# my $episode_num = (defined $prog_ref->{'ns1:EpisodeNumber'}) ? $prog_ref->{'ns1:EpisodeNumber'} : "";
+# my $series_num = (defined $prog_ref->{'ns5:SeriesNumber'}) ? $prog_ref->{'ns5:SeriesNumber'} : "";
+# my $episode_num = (defined $prog_ref->{'ns5:EpisodeNumber'}) ? $prog_ref->{'ns5:EpisodeNumber'} : "";
# if ((defined ) && (defined )) {
-# if ($prog_ref->{'ns1:SeriesNumber'} =~ s/(?:S(?:Series\s*)?(\d+),\s*)//i) {
-# my $xmltv_ns = ($1 - 1)." . ".($prog_ref->{'ns1:EpisodeNumber'} - 1)." . ";
+# if ($prog_ref->{'ns5:SeriesNumber'} =~ s/(?:S(?:Series\s*)?(\d+),\s*)//i) {
+# my $xmltv_ns = ($1 - 1)." . ".($prog_ref->{'ns5:EpisodeNumber'} - 1)." . ";
# $prog->{'episode-num'} = [[ $xmltv_ns, 'xmltv_ns' ]];
# }
# else {
-# my $xmltv_ns = ($prog_ref->{'ns1:SeriesNumber'} - 1)." . ".($prog_ref->{'ns1:EpisodeNumber'} - 1)." . 0";
+# my $xmltv_ns = ($prog_ref->{'ns5:SeriesNumber'} - 1)." . ".($prog_ref->{'ns5:EpisodeNumber'} - 1)." . 0";
# $prog->{'episode-num'} = [[ $xmltv_ns, 'xmltv_ns' ]];
# }
# }
# else {
-# $prog->{'episode-num'} = [[ $prog_ref->{'ns1:EpisodeNumber'}, 'onscreen' ]] if (defined $prog_ref->{'ns1:EpisodeNumber'});
+# $prog->{'episode-num'} = [[ $prog_ref->{'ns5:EpisodeNumber'}, 'onscreen' ]] if (defined $prog_ref->{'ns5:EpisodeNumber'});
# }
######### here #### mb try to get episode numbers - not real good with fox - lots of prints to get rid of
#########
- if (defined($prog->{'episode-num'}) ) { print("#### Episodes pre-defined: Title: $prog_ref->{'ns1:ProgramTitle'} \n"); }
+ if (defined($prog->{'episode-num'}) ) { print("#### Episodes pre-defined: Title: $prog_ref->{'ns5:ProgramTitle'} \n"); }
else { ## process episode nums
my $se_num = " ";
my $ep_num = " ";
my $ep_tit = "";
my $xmltv_ns = "";
- if (defined($prog_ref->{'ns1:EpisodeTitle'})) { $ep_tit = $prog_ref->{'ns1:EpisodeTitle'}; }
- if (defined($prog_ref->{'ns1:SeriesNumber'})) { $se_num = $prog_ref->{'ns1:SeriesNumber'} ;}
- if (defined($prog_ref->{'ns1:EpisodeNumber'})) { $ep_num = $prog_ref->{'ns1:EpisodeNumber'}; }
+ if (defined($prog_ref->{'ns5:EpisodeTitle'})) { $ep_tit = $prog_ref->{'ns5:EpisodeTitle'}; }
+ if (defined($prog_ref->{'ns5:SeriesNumber'})) { $se_num = $prog_ref->{'ns5:SeriesNumber'} ;}
+ if (defined($prog_ref->{'ns5:EpisodeNumber'})) { $ep_num = $prog_ref->{'ns5:EpisodeNumber'}; }
if (( $se_num ne " ") or ( $ep_num ne " "))
{ ## one of them exists
- print("#### Episodes found: Se_num: $se_num Ep_num: ($ep_num $prog_ref->{'ns1:ProgramTitle'}) [$ep_tit]\n");
+ print("#### Episodes found: Se_num: $se_num Ep_num: ($ep_num $prog_ref->{'ns5:ProgramTitle'}) [$ep_tit]\n");
if ( $se_num=~ /^S(\d+)$/) { $se_num = $1; }
if ( $se_num=~ /^Series\s+?(\d+)$/) { $se_num = $1; }
@@ -856,35 +856,35 @@ sub get_programs
# get genre and subgenre
- if ((defined $prog_ref->{'ns1:GenreCode'}) &&
- (defined $prog_ref->{'ns1:SubGenreCode'}) &&
- (defined $d->{genres}->{$prog_ref->{'ns1:GenreCode'}}->{$prog_ref->{'ns1:SubGenreCode'}})) {
- my $category = $d->{genres}->{$prog_ref->{'ns1:GenreCode'}}->{$prog_ref->{'ns1:SubGenreCode'}};
+ if ((defined $prog_ref->{'ns5:GenreCode'}) &&
+ (defined $prog_ref->{'ns5:SubGenreCode'}) &&
+ (defined $d->{genres}->{$prog_ref->{'ns5:GenreCode'}}->{$prog_ref->{'ns5:SubGenreCode'}})) {
+ my $category = $d->{genres}->{$prog_ref->{'ns5:GenreCode'}}->{$prog_ref->{'ns5:SubGenreCode'}};
$prog->{category} = [[ $category , $opt->{lang} ]];
#more accurate than method below, gets movies on non-movie channels, and misses shows on movie channels
- push(@{$prog->{category}}, ['Movie', $opt->{lang}]) if $d->{genres}->{$prog_ref->{'ns1:GenreCode'}}->{name} eq 'Movies';
-# push(@{$prog->{category}}, ['Sports', $opt->{lang}]) if $d->{genres}->{$prog_ref->{'ns1:GenreCode'}}->{name} eq 'Sport';
+ push(@{$prog->{category}}, ['Movie', $opt->{lang}]) if $d->{genres}->{$prog_ref->{'ns5:GenreCode'}}->{name} eq 'Movies';
+# push(@{$prog->{category}}, ['Sports', $opt->{lang}]) if $d->{genres}->{$prog_ref->{'ns5:GenreCode'}}->{name} eq 'Sport';
- if ((defined $d->{channels}->{$prog_ref->{'ns1:ChannelId'}}->{category}) &&
- (defined $d->{categories}->{$d->{channels}->{$prog_ref->{'ns1:ChannelId'}}->{category}})) {
- my $ch_category = $d->{categories}->{$d->{channels}->{$prog_ref->{'ns1:ChannelId'}}->{category}};
+ if ((defined $d->{channels}->{$prog_ref->{'ns5:ChannelId'}}->{category}) &&
+ (defined $d->{categories}->{$d->{channels}->{$prog_ref->{'ns5:ChannelId'}}->{category}})) {
+ my $ch_category = $d->{categories}->{$d->{channels}->{$prog_ref->{'ns5:ChannelId'}}->{category}};
# push(@{$prog->{category}}, ['Movie', $opt->{lang}]) if $ch_category eq 'Movies';
push(@{$prog->{category}}, ['Sports', $opt->{lang}]) if $ch_category eq 'Sport';
}
} else { $stats{skipped_categories}++; }
# get urls/weblinks
- if (defined $prog_ref->{'ns1:WebLink'}) {
- if (ref($prog_ref->{'ns1:WebLink'}) eq "HASH") {
- push(@{$prog->{url}}, $prog_ref->{'ns1:WebLink'}->{'ns1:Url'})
+ if (defined $prog_ref->{'ns5:WebLink'}) {
+ if (ref($prog_ref->{'ns5:WebLink'}) eq "HASH") {
+ push(@{$prog->{url}}, $prog_ref->{'ns5:WebLink'}->{'ns5:Url'})
}
- elsif (ref($prog_ref->{'ns1:WebLink'}) eq "ARRAY") {
- my @webarray = @{$prog_ref->{'ns1:WebLink'}};
+ elsif (ref($prog_ref->{'ns5:WebLink'}) eq "ARRAY") {
+ my @webarray = @{$prog_ref->{'ns5:WebLink'}};
my $u = 0;
while ($u <= $#webarray) {
- push(@{$prog->{url}}, $webarray[$u]->{'ns1:Url'});
+ push(@{$prog->{url}}, $webarray[$u]->{'ns5:Url'});
$u++;
}
}
@@ -893,38 +893,38 @@ sub get_programs
# TODO: get star-rating/criticsRating
# get date/YearOfProduction
- $prog->{date} = $prog_ref->{'ns1:YearOfProduction'} if (defined $prog_ref->{'ns1:YearOfProduction'});
+ $prog->{date} = $prog_ref->{'ns5:YearOfProduction'} if (defined $prog_ref->{'ns5:YearOfProduction'});
# get country
- push(@{($prog->{country})}, [$prog_ref->{'ns1:CountryOfOrigin'}]) if (defined $prog_ref->{'ns1:CountryOfOrigin'});
+ push(@{($prog->{country})}, [$prog_ref->{'ns5:CountryOfOrigin'}]) if (defined $prog_ref->{'ns5:CountryOfOrigin'});
# get language
- $prog->{language}->[0] = $prog_ref->{'ns1:Language'} if (defined $prog_ref->{'ns1:Language'});
+ $prog->{language}->[0] = $prog_ref->{'ns5:Language'} if (defined $prog_ref->{'ns5:Language'});
# get colour
- if (defined $prog_ref->{'ns1:ColourType'}) {
- $prog->{video}->{colour} = ($prog_ref->{'ns1:ColourType'} =~ /colour|color/i) ? "1" : "0";
+ if (defined $prog_ref->{'ns5:ColourType'}) {
+ $prog->{video}->{colour} = ($prog_ref->{'ns5:ColourType'} =~ /colour|color/i) ? "1" : "0";
}
# get premiere
$prog->{premiere} = ["New Episode", $opt->{lang} ]
- if (defined $prog_ref->{'ns1:NewEpisode'} && ($prog_ref->{'ns1:NewEpisode'} ne "false"));
+ if (defined $prog_ref->{'ns5:NewEpisode'} && ($prog_ref->{'ns5:NewEpisode'} ne "false"));
$prog->{premiere} = ["Premiere", $opt->{lang} ]
- if (defined $prog_ref->{'ns1:PremiereInd'} && ($prog_ref->{'ns1:PremiereInd'} ne "false"));
+ if (defined $prog_ref->{'ns5:PremiereInd'} && ($prog_ref->{'ns5:PremiereInd'} ne "false"));
# <ContentWarning>als</ContentWarning>
# 'DSTInd' => 'true', 'ProgramAvailableInd' => 'true'
Shepherd::Common::cleanup($prog);
- if (defined $prog_ref->{'ns1:ProgramId'}) {
- my $prog_id = $prog->{channel} . $prog_ref->{'ns1:ProgramId'};
+ if (defined $prog_ref->{'ns5:ProgramId'}) {
+ my $prog_id = $prog->{channel} . $prog_ref->{'ns5:ProgramId'};
my $eptitle = "";
- $eptitle = $prog_ref->{'ns1:EpisodeTitle'} if (defined($prog_ref->{'ns1:EpisodeTitle'}));
+ $eptitle = $prog_ref->{'ns5:EpisodeTitle'} if (defined($prog_ref->{'ns5:EpisodeTitle'}));
-# print ("*** Inserting ProgID $prog_id into cache...($prog_ref->{'ns1:ProgramTitle'})[$eptitle]\n");
+# print ("*** Inserting ProgID $prog_id into cache...($prog_ref->{'ns5:ProgramTitle'})[$eptitle]\n");
$data_cache->{prog_cache}->{$prog_id}->{progid} = $prog_id;
- $data_cache->{prog_cache}->{$prog_id}->{title} = $prog_ref->{'ns1:ProgramTitle'};
+ $data_cache->{prog_cache}->{$prog_id}->{title} = $prog_ref->{'ns5:ProgramTitle'};
$data_cache->{prog_cache}->{$prog_id}->{eptitle} = $eptitle;
$data_cache->{prog_cache}->{$prog_id}->{first_used} = $script_start_time;
$data_cache->{prog_cache}->{$prog_id}->{last_used} = $script_start_time;
@@ -934,15 +934,15 @@ sub get_programs
$cache_dirty = 1;
# &write_cache;
}
- elsif (defined $prog_ref->{'ns1:EventId'}) {
- my $event_id = $prog->{channel} . $prog_ref->{'ns1:EventId'};
+ elsif (defined $prog_ref->{'ns5:EventId'}) {
+ my $event_id = $prog->{channel} . $prog_ref->{'ns5:EventId'};
my $eptitle = "";
- $eptitle = $prog_ref->{'ns1:EpisodeTitle'} if (defined($prog_ref->{'ns1:EpisodeTitle'}));
+ $eptitle = $prog_ref->{'ns5:EpisodeTitle'} if (defined($prog_ref->{'ns5:EpisodeTitle'}));
- print ("*** Inserting EventID $event_id into cache... ($prog_ref->{'ns1:ProgramTitle'})[$eptitle]\n");
+ print ("*** Inserting EventID $event_id into cache... ($prog_ref->{'ns5:ProgramTitle'})[$eptitle]\n");
$data_cache->{event_cache}->{$event_id}->{eventid} = $event_id;
- $data_cache->{event_cache}->{$event_id}->{title} = $prog_ref->{'ns1:ProgramTitle'};
+ $data_cache->{event_cache}->{$event_id}->{title} = $prog_ref->{'ns5:ProgramTitle'};
$data_cache->{event_cache}->{$event_id}->{eptitle} = $eptitle;
$data_cache->{event_cache}->{$event_id}->{first_used} = $script_start_time;
$data_cache->{event_cache}->{$event_id}->{last_used} = $script_start_time;
@@ -1017,21 +1017,21 @@ sub soap_search_events
} else {
Shepherd::Common::log("DEBUG: soap_search_events got: $data") if ((defined $opt->{debug}) && ($opt->{debug} > 1));
- $parsed_xml = XMLin($data , forcearray => [ qw(ns1:Event) ]);
+ $parsed_xml = XMLin($data , forcearray => [ qw(ns5:Event) ]);
print Dumper( $parsed_xml) if ((defined $opt->{debug}) && ($opt->{debug} > 1));
- if (!defined $parsed_xml->{'soapenv:Body'}->{'ns1:SearchEventsOut'}) {
+ if (!defined $parsed_xml->{'soapenv:Body'}->{'ns5:SearchEventsOut'}) {
$failure_code = "no_SearchEventsOut";
} else {
- $ref = $parsed_xml->{'soapenv:Body'}->{'ns1:SearchEventsOut'};
- if (!defined $ref->{'ns1:Events'}->{'ns1:Event'}) {
+ $ref = $parsed_xml->{'soapenv:Body'}->{'ns5:SearchEventsOut'};
+ if (!defined $ref->{'ns5:Events'}->{'ns5:Event'}) {
$failure_code = "no_Events";
} else {
###
- if ((ref $ref->{'ns1:Events'}->{'ns1:Event'} ne "ARRAY") || (scalar(@{$ref->{'ns1:Events'}->{'ns1:Event'}}) < 1))
+ if ((ref $ref->{'ns5:Events'}->{'ns5:Event'} ne "ARRAY") || (scalar(@{$ref->{'ns5:Events'}->{'ns5:Event'}}) < 1))
{ $failure_code = "not_array_Event";
-### if (ref $ref->{'ns1:Events'}->{'ns1:Event'} ne "ARRAY") {
+### if (ref $ref->{'ns5:Events'}->{'ns5:Event'} ne "ARRAY") {
### $failure_code = "not_array_Events";
} else {
$found_array = 1; # success
@@ -1079,14 +1079,14 @@ sub soap_get_event_details
$failure_code = "no_GetEventDetails_data";
} else {
Shepherd::Common::log("DEBUG: soap_get_event_details got: $data") if ((defined $opt->{debug}) && ($opt->{debug} > 1));
- $parsed_xml = XMLin($data, forcearray => [ qw( ns1:EventDetail ns1:Actor ns1:Director ns1:Writer) ]);
+ $parsed_xml = XMLin($data, forcearray => [ qw( ns5:EventDetail ns5:Actor ns5:Director ns5:Writer) ]);
- if (!defined $parsed_xml->{'soapenv:Body'}->{'ns1:GetEventDetailsOut'}) {
+ if (!defined $parsed_xml->{'soapenv:Body'}->{'ns5:GetEventDetailsOut'}) {
$failure_code = "no_GetEventDetailsOut";
} else {
- $ref = $parsed_xml->{'soapenv:Body'}->{'ns1:GetEventDetailsOut'};
- if (ref $ref->{'ns1:EventDetail'} ne "ARRAY") {
- my $s1st = ref $ref->{'ns1:EventDetail'};
+ $ref = $parsed_xml->{'soapenv:Body'}->{'ns5:GetEventDetailsOut'};
+ if (ref $ref->{'ns5:EventDetail'} ne "ARRAY") {
+ my $s1st = ref $ref->{'ns5:EventDetail'};
$failure_code = "not_array_EventDetail It is a $s1st";
} else {
$found_array = 1; # success
View
2 status
@@ -9,7 +9,7 @@ grabber oztivo 2.48
grabber yahoo7widget 2.27
grabber abc_website 4.11
grabber rex 9.1.0
-grabber foxtel_swf 2.04
+grabber foxtel_swf 3.00
grabber acctv_website 0.09
grabber sbsweb 4.04
grabber zaxmltv 0.03

0 comments on commit 167c129

Please sign in to comment.