projects
/
rec-radiko.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
95f6952
)
録音されたファイルにアクセス権を設定するようにした.
master
author
satomichan
<git.20240901@...>
Wed, 25 Sep 2024 11:56:09 +0000
(20:56 +0900)
committer
satomichan
<git.20240901@...>
Wed, 25 Sep 2024 11:56:09 +0000
(20:56 +0900)
rec-radiko.pl
patch
|
blob
|
history
diff --git
a/rec-radiko.pl
b/rec-radiko.pl
index 3d2a9c6edef37da1d03d25aeb55265e746745fa0..15c38abcacc45d39983e34847bc7444195186119 100644
(file)
--- a/
rec-radiko.pl
+++ b/
rec-radiko.pl
@@
-43,6
+43,7
@@
my $BASH = `which bash | tr -d '\n'`;
my $ECHO = `which echo | tr -d '\n'`;
my $SLEEP = `which sleep | tr -d '\n'`;
my $RM = `which rm | tr -d '\n'`;
my $ECHO = `which echo | tr -d '\n'`;
my $SLEEP = `which sleep | tr -d '\n'`;
my $RM = `which rm | tr -d '\n'`;
+my $CHMOD = `which chmod | tr -d '\n'`;
@@
-55,9
+56,10
@@
die "保存先 $DIR_SAVE_TO に書き込み権限がありません."
# 動作モード
# 動作モード
-my $is_check_mode = 0;
-my $is_conv_to_mp3 = 1;
-my $SLEEP_TIME_SEC = 5;
+my $is_check_mode = 0;
+my $is_conv_to_mp3 = 1;
+my $SLEEP_TIME_SEC = 5;
+my $FILE_PERMISSION = 644;
@@
-103,9
+105,10
@@
my $mp3 = "${file_name_base}.mp3";
# コマンド構築
# コマンド構築
-my $rec_cmd = "cd $ENV{RADIKO_SAVE_TO}
; $RADISH -t radiko -s $station -d $min -o $m4a
; ";
+my $rec_cmd = "cd $ENV{RADIKO_SAVE_TO}
; $RADISH -t radiko -s $station -d $min -o $m4a; $CHMOD $FILE_PERMISSION $m4a
; ";
if ($is_conv_to_mp3) {
if ($is_conv_to_mp3) {
- $rec_cmd .= "$FFMPEG -i $m4a $mp3 &> /dev/null ; $SLEEP $SLEEP_TIME_SEC ; if [ -s $mp3 ]; then $RM $m4a; fi";
+ $rec_cmd .= "$FFMPEG -i $m4a $mp3 &> /dev/null; $SLEEP $SLEEP_TIME_SEC; ".
+ "if [ -s $mp3 ]; then $RM $m4a; $CHMOD $FILE_PERMISSION $mp3; fi";
}
my $at_time = sprintf('%d:%02d %02d.%02d.%02d', $time_h, $time_m, $d, $m, ($y - int($y/100)*100 ) );
}
my $at_time = sprintf('%d:%02d %02d.%02d.%02d', $time_h, $time_m, $d, $m, ($y - int($y/100)*100 ) );