summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-02-21 10:42:26 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-02-21 10:42:26 (GMT)
commit9c98f75fd60ecf15981b8964c0021a0b5a0ebc6f (patch)
tree79255295441a1f384db4b669c03a87bb8c2754d1
parenta50293d68c027412248e4f2d4c6372a8eeff7687 (diff)
fixed onda-info importer
-rwxr-xr-xrhimport-oi8
1 files changed, 5 insertions, 3 deletions
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";