Normalized indent with perltidy -b -bext='/' -t -et 4 -io make-all-podcasts.pl.
This commit is contained in:
parent
c7306eedc2
commit
4d71cd525e
@ -34,8 +34,8 @@ my $textwebpage="<ul>\n";
|
||||
|
||||
GetOptions ("help" => \$help,
|
||||
"config=s" => \$config,
|
||||
"mp3" => \$mp3,
|
||||
"verbose" => \$verbose,
|
||||
"mp3" => \$mp3,
|
||||
"verbose" => \$verbose,
|
||||
"dryrun" => \$dryrun);
|
||||
|
||||
if($help) {
|
||||
@ -86,19 +86,19 @@ sub process {
|
||||
my $title = "Libre à vous ! du $long_date sur Cause Commune";
|
||||
my $ffmpeg_bin = $data->{ffmpeg_bin};
|
||||
|
||||
my $option_mp3_meta_data_script;
|
||||
my @formats_files;
|
||||
|
||||
if($mp3) {
|
||||
@formats_files = qw/ogg mp3/;
|
||||
$option_mp3_meta_data_script = "yes";
|
||||
}
|
||||
else {
|
||||
@formats_files = qw/ogg/;
|
||||
$option_mp3_meta_data_script = "no";
|
||||
}
|
||||
my $option_mp3_meta_data_script;
|
||||
my @formats_files;
|
||||
|
||||
for my $chapter (values @{$data->{chapters}}) {
|
||||
if($mp3) {
|
||||
@formats_files = qw/ogg mp3/;
|
||||
$option_mp3_meta_data_script = "yes";
|
||||
}
|
||||
else {
|
||||
@formats_files = qw/ogg/;
|
||||
$option_mp3_meta_data_script = "no";
|
||||
}
|
||||
|
||||
for my $chapter (values @{$data->{chapters}}) {
|
||||
my $start = $chapter->{start_timestamp};
|
||||
my $end = $chapter->{end_timestamp};
|
||||
my $short_chapter_name = $chapter->{short_chapter_name};
|
||||
@ -164,7 +164,7 @@ sub process {
|
||||
}
|
||||
|
||||
# renaming to target OGG and MP3
|
||||
foreach my $format (@formats_files) {
|
||||
foreach my $format (@formats_files) {
|
||||
my $target_name = "$source_name-$short_chapter_name.$format";
|
||||
my $command = "mv output.$format $target_name";
|
||||
if($dryrun) {
|
||||
@ -202,7 +202,7 @@ sub process {
|
||||
|
||||
# putting metadata in main podcast
|
||||
my $url = "https://media.april.org/audio/radio-cause-commune/libre-a-vous/emissions/$short_date/$source_name.ogg";
|
||||
my $command = "$meta_data_script -s \"$source_name.ogg\" -d \"output\" -u \"$url\" -t \"$title\" -p \"$ffmpeg_bin\" -y \"$year\" -m \"$option_mp3_meta_data_script\"";
|
||||
my $command = "$meta_data_script -s \"$source_name.ogg\" -d \"output\" -u \"$url\" -t \"$title\" -p \"$ffmpeg_bin\" -y \"$year\" -m \"$option_mp3_meta_data_script\"";
|
||||
if($dryrun) {
|
||||
print "$command\n";
|
||||
} else {
|
||||
@ -218,7 +218,7 @@ sub process {
|
||||
}
|
||||
|
||||
# renaming to target OGG and MP3
|
||||
foreach my $format (@formats_files) {
|
||||
foreach my $format (@formats_files) {
|
||||
|
||||
my $command = "mv output.$format $source_name.$format";
|
||||
if($dryrun) {
|
||||
@ -257,9 +257,9 @@ sub process {
|
||||
binmode(STDOUT, ":utf8");
|
||||
print "\nText for the web page of the radio program :\n\n$textwebpage\n";
|
||||
|
||||
if(! $mp3) {
|
||||
print "MP3 files not generated, please use --mp3 option to generate them\n";
|
||||
}
|
||||
if(! $mp3) {
|
||||
print "MP3 files not generated, please use --mp3 option to generate them\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user