From 1c0384ece09bfacd428d7063d9e9c247d7fc1bca Mon Sep 17 00:00:00 2001 From: satomichan Date: Wed, 4 Feb 2026 00:00:54 +0900 Subject: [PATCH] =?utf8?q?=E3=83=A9=E3=82=B8=E3=82=AA=E6=B7=B1=E5=A4=9C?= =?utf8?q?=E4=BE=BF=E3=81=AE=E7=95=AA=E7=B5=84=E8=A1=A8=E5=BD=A2=E5=BC=8F?= =?utf8?q?=E5=A4=89=E6=9B=B4=E3=81=AB=E5=AF=BE=E5=87=A6.=20=E3=83=95?= =?utf8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E5=90=8D=E3=81=8C=E9=95=B7=E3=81=8F?= =?utf8?q?=E3=81=AA=E3=82=8A=E3=81=99=E3=81=8E=E3=81=AA=E3=81=84=E3=82=88?= =?utf8?q?=E3=81=86,=20=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E6=9C=80?= =?utf8?q?=E5=A4=A7=E9=95=B7=E3=82=92160bytes=E3=81=AB=E5=88=B6=E9=99=90.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- get-nhk-title.pl | 7 ++++--- rec-nhk-radio.pl | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/get-nhk-title.pl b/get-nhk-title.pl index 578cf2f..656c583 100755 --- a/get-nhk-title.pl +++ b/get-nhk-title.pl @@ -51,8 +51,9 @@ NHKオンライン テキスト版 (https://k.nhk.jp/) で提供されている 複数指定することも出来ます. 例) --li 3,4 Short出力モード のときに --shinyabin を指定すると, - 番組が ラジオ深夜便 だった場合に 番組タイトルを 3,4行目などを組み - 合わせたものを出力します (1行目のみだと特集内容がわからないため). + 番組が ラジオ深夜便 だった場合に, 番組タイトルを 「ラジオ深夜便」+ + 2,3行目を組み合わせた文字列にします (1行目のみだと特集内容がわか + らないため). --nominutes または -m を指定されていると, 放送長さ を出力しません. @@ -129,7 +130,7 @@ if ($program) { #ラジオ深夜便対策 if ($option{shinyabin} && $program->{list}[0] =~ /^ラジオ深夜便/) { $title = 'ラジオ深夜便'; - $option{li} = '3,4'; + $option{li} = '2,3'; } #タイトル取得・エスケープ diff --git a/rec-nhk-radio.pl b/rec-nhk-radio.pl index 53fd5eb..f4f24a8 100755 --- a/rec-nhk-radio.pl +++ b/rec-nhk-radio.pl @@ -32,7 +32,8 @@ use Getopt::Long qw(:config posix_default no_ignore_case gnu_compat); use Time::Piece; use Encode; -my $FILE_PERMISSION = 644; +my $FILE_PERMISSION = 644; +my $MAX_TITLE_LENGTH = 160; @@ -151,7 +152,8 @@ $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_nhk-%s_%s_%dmin', $y, $m, $d, $time_h, $time_m, $station, $title, $min); +my $file_name_base = sprintf('%04d-%02d-%02d_%02d%02d_nhk-%s_%s_%dmin', $y, $m, $d, $time_h, $time_m, $station, + substr($title, 0, $MAX_TITLE_LENGTH) , $min); my $mp3 = "${file_name_base}.mp3"; my $txt = "${file_name_base}.txt"; -- 2.43.0