Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: dekarl/nonametv
base: 20c4cc5181
...
head fork: dekarl/nonametv
compare: 7024bf2a8f
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
38 examples/de/nonametv.conf
@@ -24,6 +24,23 @@
Importers =>
{
+ AFN =>
+ {
+ Type => 'AFN',
+ Channels => {
+ 'family.myafn.net' => [ 'AFN|family', 'AFN|family', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'movie.myafn.net' => [ 'AFN|movie', 'AFN|movie', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'news.myafn.net' => [ 'AFN|news', 'AFN|news', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'atlantic.prime.myafn.net' => [ 'AFN|prime Atlantic', 'AFN|prime Atlantic', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'freedom.prime.myafn.net' => [ 'AFN|prime Freedom', 'AFN|prime Freedom', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'pacific.prime.myafn.net' => [ 'AFN|prime Pacific', 'AFN|prime Pacific', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'spectrum.myafn.net' => [ 'AFN|spectrum', 'AFN|spectrum', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'sports.myafn.net' => [ 'AFN|sports', 'AFN|sports', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'xtra.myafn.net' => [ 'AFN|xtra', 'AFN|xtra', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ 'pentagonchannel.myafn.net' => [ 'Pentagon Channel', 'Pentagon Channel', 'en', 0, undef, undef, 'http://myafn.dodmedia.osd.mil/', 'TV' ],
+ },
+ },
+
Arte_http =>
{
Type => 'Arte_http',
@@ -32,6 +49,7 @@
},
MaxWeeks => 4,
},
+
DasErsteDE =>
{
Type => 'DasErsteDE',
@@ -92,8 +110,10 @@
Type => 'MTVde',
MaxWeeks => 6,
Channels => {
+ 'comedycentral.ch' => [ 'Comedy Central Switzerland', '3', 'de', 0, undef, undef, 'http://comedycentral.de/', 'TV' ],
'comedycentral.de' => [ 'Comedy Central Germany', '16', 'de', 0, undef, undef, 'http://comedycentral.de/', 'TV' ],
- 'at.nick.de' => [ 'Nickelodeon Austria', '33', 'de', 0, undef, undef, 'http://www.nick.de/', 'TV' ],
+# 'at.nick.de' => [ 'Nickelodeon Austria', '33', 'de', 0, undef, undef, 'http://www.nick.de/', 'TV' ],
+ 'nick.ch' => [ 'Nickelodeon Switzerland', '25', 'de', 0, undef, undef, 'http://www.nick.ch/', 'TV' ],
'nick.de' => [ 'Nickelodeon Germany', '17', 'de', 0, undef, undef, 'http://www.nick.de/', 'TV' ],
},
HaveVGMediaLicense => 'no',
@@ -232,6 +252,7 @@
'arteeinsextra.ard.de' => [ 'arte/EinsExtra', '', 'de', 0, undef, undef, undef, 'TV'],
'neokika.zdfmobil.de' => [ 'neo/KiKa', '', 'de', 0, undef, undef, undef, 'TV'],
'nickcc.mtvnetworks.de' => [ 'Nickelodeon / Comedy Central (Germany)', '', 'de', 0, undef, undef, undef, 'TV'],
+ 'ch.nickcc.mtvnetworks.de' => [ 'Nickelodeon / Comedy Central (Switzerland)', '', 'de', 0, undef, undef, undef, 'TV'],
},
},
@@ -293,6 +314,21 @@
{
Type => 'Fixups',
},
+
+ # for AFN
+ TvdbEn => # might want multiple instances of the same type to handle multiple language setups
+ {
+ Type => 'Tvdb',
+ Language => 'en', # main language used for initializing and languagestrings
+ ApiKey => 'see override.conf', # verify if it's per software or per installation
+ },
+
+ TmdbEn =>
+ {
+ Type => 'Tmdb',
+ Language => 'en-US', # main language/region used for initializing and languagestrings
+ ApiKey => 'see override.conf', # verify if it's per software or per installation
+ OnlyAugmentFacts => 1, # don't bill me for using texts that sound like yours (when it's not clear who has what rights, you included!)
},
Exporters =>
View
190 lib/NonameTV/Importer/AFN.pm
@@ -0,0 +1,190 @@
+package NonameTV::Importer::AFN;
+
+use strict;
+use warnings;
+
+=pod
+
+Importer for AFN guide at http://myafn.dodmedia.osd.mil/508/ScheduleList.aspx
+The importer field should contain the channel name as it appears on the site, e.g. "AFN|prime Pacific"
+
+=cut
+
+use HTML::Entities;
+use HTML::TableExtract;
+use HTML::Parse;
+use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ;
+use Unicode::String;
+
+use NonameTV qw/Html2Xml norm/;
+use NonameTV::DataStore::Helper;
+use NonameTV::Importer::BaseDaily;
+use NonameTV::Log qw/p w f/;
+
+use base 'NonameTV::Importer::BaseDaily';
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = $class->SUPER::new( @_ );
+ bless ($self, $class);
+
+ if ($self->{MaxDays} >= 30) {
+ $self->{MaxDays} = 30;
+ }
+
+ $self->{datastore}->{augment} = 1;
+
+ return $self;
+}
+
+sub Object2Url {
+ my $self = shift;
+ my( $objectname, $chd ) = @_;
+
+ my( $xmltvid, $year, $month, $day ) = ( $objectname =~ /^(.+)_(\d+)-(\d+)-(\d+)$/ );
+
+ my $url = "http://myafn.dodmedia.osd.mil/508/ScheduleList.aspx?TimeZone=(GMT)%20Greenwich%20Mean%20Time&StartDate=$month/$day/$year&";
+
+ # Only one url to look at and no error
+ return ([$url], undef);
+}
+
+sub FilterContent {
+ my $self = shift;
+ my( $cref, $chd ) = @_;
+
+ $$cref =~ s|\r||g;
+
+ my $doc = Html2Xml ($$cref);
+ if( not defined $doc ) {
+ return (undef, 'Html2Xml failed' );
+ }
+
+ # remove head
+ foreach my $node ($doc->find ('//head')->get_nodelist) {
+ $node->unbindNode ();
+ }
+
+ # save program table
+ my $saveddata;
+ my @nodes = $doc->find ('//table[@class="GridView"]')->get_nodelist();
+ $saveddata = $nodes[0];
+ $nodes[0]->unbindNode ();
+
+ # drop body content
+ foreach my $node ($doc->find ('/html/body')->get_nodelist) {
+ $node->removeChildNodes ();
+ $node->addChild ($saveddata);
+ }
+
+ # remove bgcolor
+ foreach my $node ($doc->find ('//@bgcolor')->get_nodelist) {
+ $node->unbindNode ();
+ }
+
+
+ $cref = $doc->toStringHTML ();
+
+ return( \$cref, undef);
+}
+
+sub ContentExtension {
+ return 'html';
+}
+
+sub FilteredExtension {
+ return 'html';
+}
+
+
+sub ImportContent {
+ my $self = shift;
+
+ my( $batch_id, $cref, $chd ) = @_;
+
+ my( $xmltvid, $year, $month, $day ) = ( $batch_id =~ /^(.+)_(\d+)-(\d+)-(\d+)$/ );
+
+ my $ds = $self->{datastore};
+
+ my $te = HTML::TableExtract->new(
+# keep_html => 1
+ );
+
+ $te->parse($$cref);
+
+ my $table = $te->table(0, 0);
+
+ for (my $i = 1; $i < $table->row_count(); $i++) {
+ my @row = $table->row($i);
+
+ if( $chd->{grabber_info} ne norm( $row[1] ) ){
+ next;
+ }
+
+ my ( $hour, $minute, $ampm ) = ( $row[0] =~ m|(\d+):(\d+) ([AP]M)| );
+ if( $hour == 12 ) {
+ $hour = 0;
+ }
+ if( $ampm eq 'PM' ){
+ $hour += 12;
+ }
+
+ my $title = norm( $row[2] );
+ $title =~ s|:$||;
+ my ($rating) = ( $row[3] =~ m|\((.*?)\s*| );
+ $rating = norm( $rating );
+ my ($duration) = ( $row[4] =~ m|\((.*?)\s*mins| );
+ $duration = norm( $duration );
+ my $episodetitle = norm( $row[5] );
+ my $description = norm( $row[6] );
+
+ my $start = DateTime->new(
+ year => $year,
+ month => $month,
+ day => $day,
+ hour => $hour,
+ minute => $minute,
+ time_zone => 'UTC'
+ );
+
+ my $end = $start->clone()->add( minutes => $duration );
+
+ my $ce = {
+ channel_id => $chd->{id},
+ start_time => $start->ymd("-") . " " . $start->hms(":"),
+ end_time => $end->ymd("-") . " " . $end->hms(":"),
+ title => $title
+ };
+
+ if( $rating ){
+ $ce->{rating} = $rating;
+ }
+
+ if( $description ){
+ $ce->{description} = $description;
+ }
+
+ if( $episodetitle ){
+ if( $episodetitle eq 'Live' ){
+ $ce->{program_type} = 'tvshow';
+ }elsif( $episodetitle =~ m|^Prod Year| ){
+ my( $year )=( $episodetitle =~ m|^Prod Year (\d{4})$| );
+ $ce->{production_date} = $year . '-01-01';
+ $ce->{program_type} = 'movie';
+ }else{
+ # simplify " (Pt. #)" to " (#)"
+ $episodetitle =~ s|\s*\(Pt\.\s+(\d+)\)$| ($1)|;
+ $ce->{subtitle} = $episodetitle;
+ $ce->{program_type} = 'series';
+ }
+ }
+
+ $ds->AddProgramme( $ce );
+ }
+
+ return 1;
+}
+
+
+1;
View
1  lib/NonameTV/Importer/KiKaDE.pm
@@ -75,6 +75,7 @@ sub FilterContent {
$$cref =~ s|&#x91;|'|g;
$$cref =~ s|&#x92;|'|g;
$$cref =~ s|&#x93;|"|g;
+ $$cref =~ s|&#x94;|"|g;
$$cref =~ s|&#x95;|&#x2022;|g; # *
$$cref =~ s|&#x96;|-|g;
$$cref =~ s|&#x97;|-|g;
View
2  tools/de/nonametv-import-allhttp
@@ -19,12 +19,14 @@ NONAMETV="tools/nonametv-import"
#$NONAMETV SverigesRadio $1 $2 $3
#$NONAMETV Eurosport $1 $2 $3
+$NONAMETV AFN $1 $2 $3
$NONAMETV Arte_http $1 $2 $3
$NONAMETV DasErsteDE $1 $2 $3
$NONAMETV DRadioDE $1 $2 $3
$NONAMETV DRadioWissenDE $1 $2 $3
$NONAMETV DreiSat $1 $2 $3
$NONAMETV KiKaDE $1 $2 $3
+$NONAMETV MTVde $1 $2 $3
$NONAMETV ORF $1 $2 $3
$NONAMETV RadioSevenSE $1 $2 $3
$NONAMETV RadioXDE $1 $2 $3

No commit comments for this range

Something went wrong with that request. Please try again.