diff options
-rwxr-xr-x | rhimport-oi | 8 |
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"; |