From 9c98f75fd60ecf15981b8964c0021a0b5a0ebc6f Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 21 Feb 2016 11:42:26 +0100 Subject: fixed onda-info importer diff --git a/rhimport-oi b/rhimport-oi index 3ed4e5b..291d755 100755 --- a/rhimport-oi +++ b/rhimport-oi @@ -84,7 +84,7 @@ print "day of next Radio Helsinki broadcast: " . Date::Calc::Date_to_Text(@impor print "Number of next broadcast: " . $broadcast_num . "\n"; my $id = sprintf("%04d-%02d-%02d", @import_date); -my $bdfile = sprintf('.*onda.?info_%d.*\.mp3$', $broadcast_num); +my $bdfile = sprintf('.*onda.?info[_-]%d.*\.mp3$', $broadcast_num); my $current_stat = `cat $STAT_FILE`; my ($current_id, $current_file) = $current_stat =~ m/^(.*)\n(.*)/; @@ -110,7 +110,9 @@ for my $entry ($feed->entries) { my $sum_title = decode_entities($entry->title); my $sum_text = decode_entities($entry->content->body); - my $ff = File::Fetch->new(uri => $entry->enclosure->url); + my $uri = $entry->enclosure->url; + $uri =~ s/https/http/; + my $ff = File::Fetch->new(uri => $uri); $out_file = $ff->output_file; if(!rhimport::check_file_extension($out_file)) { print "\n\nThe extension of the matching file '". $out_file . "' seems to be wrong - manual import necessary!!!\n"; @@ -118,7 +120,7 @@ for my $entry ($feed->entries) { exit 1; } - print $broadcast_num . ": downloading " . $entry->enclosure->url . " (" . $entry->enclosure->length . " Bytes) .. "; + print $broadcast_num . ": downloading " . $uri . " (" . $entry->enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; print "ok\n"; -- cgit v0.10.2