From 98a1be65db273fbf949b50909a0700ffda7b71fd Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 20 Jun 2014 18:04:34 +0000 Subject: added extension check to all autoimports diff --git a/rhimport-btl b/rhimport-btl index ad177b9..e212793 100755 --- a/rhimport-btl +++ b/rhimport-btl @@ -112,6 +112,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print $bdfile . ": downloading " . $entry->enclosure->url . " (" . $entry->enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-dn b/rhimport-dn index 0468dc8..a23d32b 100755 --- a/rhimport-dn +++ b/rhimport-dn @@ -120,6 +120,11 @@ for my $entry ($files_feed->entries) { exit 0; } $out_file = $path[-1]; + 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"; + $dbh->disconnect(); + exit 1; + } print $1 . ": downloading " . $entry->enclosure->url . " (" . $entry->enclosure->length . " Bytes) .. "; diff --git a/rhimport-fe b/rhimport-fe index c6fba81..fbcaca1 100755 --- a/rhimport-fe +++ b/rhimport-fe @@ -127,6 +127,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print $regexp . ": downloading " . $entry->enclosure->url . " (" . $entry->enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-fw b/rhimport-fw index 7109198..8ce5ef5 100755 --- a/rhimport-fw +++ b/rhimport-fw @@ -138,6 +138,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bnum . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-nw b/rhimport-nw index 12dd2df..42f4aac 100755 --- a/rhimport-nw +++ b/rhimport-nw @@ -121,6 +121,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bdfile . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-o94n b/rhimport-o94n index 6299bc1..dc6ff54 100755 --- a/rhimport-o94n +++ b/rhimport-o94n @@ -140,6 +140,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bdfile . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-oi b/rhimport-oi index d596c0b..a08490d 100755 --- a/rhimport-oi +++ b/rhimport-oi @@ -113,6 +113,12 @@ for my $entry ($feed->entries) { my $ff = File::Fetch->new(uri => $entry->enclosure->url); $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"; + $dbh->disconnect(); + exit 1; + } + print $broadcast_num . ": downloading " . $entry->enclosure->url . " (" . $entry->enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; print "ok\n"; diff --git a/rhimport-ra b/rhimport-ra index 69f3310..c6c966f 100755 --- a/rhimport-ra +++ b/rhimport-ra @@ -123,6 +123,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bnum . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-rs b/rhimport-rs index 49f9564..b0387b4 100755 --- a/rhimport-rs +++ b/rhimport-rs @@ -167,6 +167,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bdfile . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-sm b/rhimport-sm index 12ed8e2..97e26ce 100755 --- a/rhimport-sm +++ b/rhimport-sm @@ -154,6 +154,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bdfile . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-sv b/rhimport-sv index 22f182f..34c4b03 100755 --- a/rhimport-sv +++ b/rhimport-sv @@ -153,6 +153,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bdfile . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-ut b/rhimport-ut index eb1cd3c..ef71c9c 100755 --- a/rhimport-ut +++ b/rhimport-ut @@ -123,6 +123,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bdexp . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; diff --git a/rhimport-zf b/rhimport-zf index c255519..c780540 100755 --- a/rhimport-zf +++ b/rhimport-zf @@ -118,7 +118,7 @@ for my $entry ($feed->entries) { 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"; $dbh->disconnect(); - exit 0; + exit 1; } print $regexp . ": downloading " . $entry->enclosure->url . " (" . $entry->enclosure->length . " Bytes) .. "; diff --git a/rhimport-zfw b/rhimport-zfw index afc6cf5..f068e8b 100755 --- a/rhimport-zfw +++ b/rhimport-zfw @@ -126,6 +126,11 @@ for my $entry ($feed->entries) { exit 0; } $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"; + $dbh->disconnect(); + exit 1; + } print " --> " . $bdfile . ": downloading " . $url . " (" . $enclosure->length . " Bytes) .. "; $file = $ff->fetch( to => '/tmp' ) or die $ff->error; -- cgit v0.10.2