From 1c9709d66dcc465a01f0a706b391e732f276a767 Mon Sep 17 00:00:00 2001 From: satomichan Date: Sun, 3 Aug 2025 20:39:46 +0900 Subject: [PATCH] =?utf8?q?=E9=8C=B2=E9=9F=B3=E5=AF=BE=E8=B1=A1=E3=82=92=20?= =?utf8?q?radiko=20=E3=81=8B=E3=82=89=20NHK=20=E3=82=89=E3=81=98=E3=82=8B?= =?utf8?q?=E2=98=85=E3=82=89=E3=81=98=E3=82=8B=20=E3=81=AB=E5=A4=89?= =?utf8?q?=E6=9B=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- rec-radiko.pl => rec-nhk-radio.pl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename rec-radiko.pl => rec-nhk-radio.pl (85%) diff --git a/rec-radiko.pl b/rec-nhk-radio.pl similarity index 85% rename from rec-radiko.pl rename to rec-nhk-radio.pl index 15c38ab..59523d7 100644 --- a/rec-radiko.pl +++ b/rec-nhk-radio.pl @@ -1,6 +1,6 @@ #!/usr/bin/env -S perl -w -# 指定時刻に radiko を録音するための at job を発行するツール. +# 指定時刻に NHK らじる★らじる を録音するための at job を発行するツール. # (https://satomichan.jp/rec-radiko) # # 録音には radish (https://github.com/uru2/radish) を利用しています. @@ -8,7 +8,7 @@ # # 使い方は引数なしで実行すると表示されます. # -# Copyright 2024 FUKUDA Satomi (https://satomichan.jp/) +# Copyright 2024-2025 FUKUDA Satomi (https://satomichan.jp/) # # Licensed under the Apache License, Version 2.0 (the “License”); # you may not use this file except in compliance with the License. @@ -76,10 +76,10 @@ unless (@ARGV) { my $script_name = basename($0, ''); my $usage = << " EOM_USAGE"; USAGE) $script_name [-c|--check] [-n|--no-conversion-to-mp3] <放送局ID> <録音開始日> <録音開始時刻> <録音長(分)> <タイトル> - ex) $script_name JOAK-FM 2024-08-25 0305 56 shinyabin_taniyama-hiroko - ex) $script_name --check JOAK-FM 2024-08-25 3:05 56 shinyabin_taniyama-hiroko + ex) $script_name tokyo-fm 2025-05-31 1230 91 scramble_taniyama-hiroko + ex) $script_name --check tokyo-fm 2025-05-31 12:30 91 scramble_taniyama-hiroko - <放送局ID>は radi.sh -l | perl -ne 'print if /radiko/../^\$/' で確認できます. + <放送局ID>は radi.sh -l で確認できます. ex) tokyo-r1, r2, tokyo-fm EOM_USAGE @@ -98,14 +98,14 @@ $title =~ s/\s+/_/g; die "無効な引数です." unless ($y && $m && $d && $time_h <= 24 && $time_h >= 0 && $time_m <= 59 && $time_m >= 0 && $min > 0 && length $title); -my $file_name_base = sprintf('%04d-%02d-%02d_%02d%02d_%s_%s', $y, $m, $d, $time_h, $time_m, $station, $title); +my $file_name_base = sprintf('%04d-%02d-%02d_%02d%02d_nhk-%s_%s', $y, $m, $d, $time_h, $time_m, $station, $title); my $m4a = "${file_name_base}.m4a"; my $mp3 = "${file_name_base}.mp3"; # コマンド構築 -my $rec_cmd = "cd $ENV{RADIKO_SAVE_TO}; $RADISH -t radiko -s $station -d $min -o $m4a; $CHMOD $FILE_PERMISSION $m4a; "; +my $rec_cmd = "cd $ENV{RADIKO_SAVE_TO}; $RADISH -t nhk -s $station -d $min -o $m4a; $CHMOD $FILE_PERMISSION $m4a; "; if ($is_conv_to_mp3) { $rec_cmd .= "$FFMPEG -i $m4a $mp3 &> /dev/null; $SLEEP $SLEEP_TIME_SEC; ". "if [ -s $mp3 ]; then $RM $m4a; $CHMOD $FILE_PERMISSION $mp3; fi"; @@ -126,3 +126,4 @@ if ($is_check_mode) { system($cmd); exit; } + -- 2.43.0