0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

スポーツ中継検出シェルスクリプト

Last updated at Posted at 2023-11-19

録画の天敵

テレビ録画について、昔から続いている天敵がいらっしゃいます。それは(好きな人には申し訳ないですが)スポーツ中継による番組表変更です。
一応HDDレコーダーなどは番組予定変更を検知する機能はついているものの、いつぞやかスパイファミリーの放送時間が2転して録画に失敗した家庭が多発した事例があるし、タイミングによってはEPG受信が間に合わない可能性もある。Mirakurun・EPGStationにしても受信を15分間隔にしてもなぜかうまくいかないことがある。

確実に録画するには

では確実に録画をするにはどうしたらいいのか?その解決方法の一つは延長で動く分を想定して長めに録画をする。そのために欲しい機能は何かを考えた結果、
・その日の中継が行われそうな時間について番組情報を取得
・対象は地上波と専門Ch以外のBS
・番組のジャンルを取得する
・延長の可能性のあるジャンルが流れるチャンネルをリストする
・同時に、予約番組のチャンネルと放送時間をリストする
・できればすべて自動検出したい

中継が延長する可能性があるジャンル

・ジャンルは0x1のスポーツ
 他ジャンルは緊急時以外はおそらくない
・サブジャンルは
 0x1野球:可能性は最も高い。時間で決着するスポーツではないし。
 0x2サッカー:延長戦、PK戦まで行く場合はありうるのかな?
 0x6オリンピック・国際大会:おそらく可能性はそこそこ高い。
・以下はよくわからないが、逆に言えば可能性を捨てきれない
 0x3ゴルフ
 0x4その他の球技
 0x8モータースポーツ
 0x9マリン・ウィンタースポーツ
・少なくとも相撲は時間が決まっているのでまず延長はしないでしょう。その他格闘技も。」陸上や水泳も割と決まっているイメージ。
・ニュース等のジャンルを含んでいれば延長することは(普通に考えれば)ない。
・野球で、他のジャンルを含んでいない場合は試合かと思いきや、実質バラエティの内容でジャンルが野球だけというケースがあるので、やはり説明文のチェックも必要かもしれない。
・↓EPGStationで使われるジャンルの番号は以下にあるようです

というわけでスポーツ中継を検出するシェルスクリプト

正直現在はむっちゃ非効率的なコードです。使いたい方はどうぞですが、微調整が必要になるのでそこは注意。今後どうにかして改良していきたい。

recchk_yakyucheck.sh
#!/bin/bash

#● Mirakurun,EPGStationのURL
epgstation_url=http://localhost:8888/
mirakurun_url=http://localhost:40772/
#● 診断結果出力ファイル指定(docker-mirakurun-epgstation/recorded/recorded/recstatus_reserve_storage.txtなど)。↓使用しない場合は=nofileにする。
textfilenotify=docker-mirakurun-epgstation/recorded/recorded/recstatus_yakyucheck.txt

echo "現在時刻をUnixTimeで出す"
timenow=$(date +'%s')
echo "現在時刻をSat 18 Nov 16:27:00 JST 2023みたいな感じで出す"
timenow2=$(date)
echo "年月日曜日時分秒"
timenow3=$(date +'%Y')"年"$(date +'%m')"月"$(date +'%d')"日"$(date +'%a')"曜日"$(date +'%u')"曜日数値(1:月,7:日)"$(date +'%H')"時"$(date +'%M')"分"$(date +'%S')"秒"

datef1=$(date +'%Y')
datef2=$(date +'%m')
datef3=$(date +'%d')
datef3p1=$(($(date +'%d')+1))
epg2030=$(date +%s --date $datef1'-'$datef2'-'$datef3' 20:31:00')

echo "今日の延長可能性ありスポーツ中継(野球サッカーその他球技中心、ニュースや相撲格闘技は対象外)" > $textfilenotify
gen_0=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[0] | .programs[] | .genre1')
gen_s0=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[0] | .programs[] | .subGenre1')
gen_1=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[1] | .programs[] | .genre1')
gen_s1=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[1] | .programs[] | .subGenre1')
gen_2=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[2] | .programs[] | .genre1')
gen_s2=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[2] | .programs[] | .subGenre1')
gen_3=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[3] | .programs[] | .genre1')
gen_s3=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[3] | .programs[] | .subGenre1')
gen_4=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[4] | .programs[] | .genre1')
gen_s4=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=true&BS=false&CS=false&SKY=false" | jq -c '.[4] | .programs[] | .subGenre1')
genb_0=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[0] | .programs[] | .genre1')
genb_s0=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[0] | .programs[] | .subGenre1')
genb_2=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[2] | .programs[] | .genre1')
genb_s2=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[2] | .programs[] | .subGenre1')
genb_3=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[3] | .programs[] | .genre1')
genb_s3=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[3] | .programs[] | .subGenre1')
genb_4=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[4] | .programs[] | .genre1')
genb_s4=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[4] | .programs[] | .subGenre1')
genb_5=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[5] | .programs[] | .genre1')
genb_s5=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[5] | .programs[] | .subGenre1')
genb_6=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[6] | .programs[] | .genre1')
genb_s6=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[6] | .programs[] | .subGenre1')
genb_7=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[7] | .programs[] | .genre1')
genb_s7=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[7] | .programs[] | .subGenre1')
genb_8=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[8] | .programs[] | .genre1')
genb_s8=$(curl -s $epgstation_url"api/schedules?startAt="$epg2030"000&endAt="$epg2030"000&isHalfWidth=true&needsRawExtended=false&GR=false&BS=true&CS=false&SKY=false" | jq -c '.[8] | .programs[] | .subGenre1')

kyoname0="RAB"
kyoname1="NHKE"
kyoname2="NHKG"
kyoname3="ABA"
kyoname4="ATV"
kyonameb0="NHKBS1"
kyonameb2="BS日テレ"
kyonameb3="BS朝日"
kyonameb4="BS_TBS"
kyonameb5="BSテレ東"
kyonameb6="BSフジ"
kyonameb7="BS11"
kyonameb8="BS12"

if [ $gen_0 = 1 ]; then
  if [ $gen_s0 = 1 ] || [ $gen_s0 = 2 ] || [ $gen_s0 = 3 ] || [ $gen_s0 = 4 ] || [ $gen_s0 = 6 ] || [ $gen_s0 = 8 ] || [ $gen_s0 = 9 ] || [ $gen_s0 = 15 ]; then
echo $kyoname0"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $gen_1 = 1 ]; then
  if [ $gen_s1 = 1 ] || [ $gen_s1 = 2 ] || [ $gen_s1 = 3 ] || [ $gen_s1 = 4 ] || [ $gen_s1 = 6 ] || [ $gen_s1 = 8 ] || [ $gen_s1 = 9 ] || [ $gen_s1 = 15 ]; then
echo $kyoname1"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $gen_2 = 1 ]; then
  if [ $gen_s2 = 1 ] || [ $gen_s2 = 2 ] || [ $gen_s2 = 3 ] || [ $gen_s2 = 4 ] || [ $gen_s2 = 6 ] || [ $gen_s2 = 8 ] || [ $gen_s2 = 9 ] || [ $gen_s2 = 15 ]; then
echo $kyoname2"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $gen_3 = 1 ]; then
  if [ $gen_s3 = 1 ] || [ $gen_s3 = 2 ] || [ $gen_s3 = 3 ] || [ $gen_s3 = 4 ] || [ $gen_s3 = 6 ] || [ $gen_s3 = 8 ] || [ $gen_s3 = 9 ] || [ $gen_s3 = 15 ]; then
echo $kyoname3"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $gen_4 = 1 ]; then
  if [ $gen_s4 = 1 ] || [ $gen_s4 = 2 ] || [ $gen_s4 = 3 ] || [ $gen_s4 = 4 ] || [ $gen_s4 = 6 ] || [ $gen_s4 = 8 ] || [ $gen_s4 = 9 ] || [ $gen_s4 = 15 ]; then
echo $kyoname4"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $genb_0 = 1 ]; then
  if [ $genb_s0 = 1 ] || [ $genb_s0 = 2 ] || [ $genb_s0 = 3 ] || [ $genb_s0 = 4 ] || [ $genb_s0 = 6 ] || [ $genb_s0 = 8 ] || [ $genb_s0 = 9 ] || [ $genb_s0 = 15 ]; then
echo $kyonameb0"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $genb_2 = 1 ]; then
  if [ $genb_s2 = 1 ] || [ $genb_s2 = 2 ] || [ $genb_s2 = 3 ] || [ $genb_s2 = 4 ] || [ $genb_s2 = 6 ] || [ $genb_s2 = 8 ] || [ $genb_s2 = 9 ] || [ $genb_s2 = 15 ]; then
echo $kyonameb2"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $genb_3 = 1 ]; then
  if [ $genb_s3 = 1 ] || [ $genb_s3 = 2 ] || [ $genb_s3 = 3 ] || [ $genb_s3 = 4 ] || [ $genb_s3 = 6 ] || [ $genb_s3 = 8 ] || [ $genb_s3 = 9 ] || [ $genb_s3 = 15 ]; then
echo $kyonameb3"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $genb_4 = 1 ]; then
  if [ $genb_s4 = 1 ] || [ $genb_s4 = 2 ] || [ $genb_s4 = 3 ] || [ $genb_s4 = 4 ] || [ $genb_s4 = 6 ] || [ $genb_s4 = 8 ] || [ $genb_s4 = 9 ] || [ $genb_s4 = 15 ]; then
echo $kyonameb4"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $genb_5 = 1 ]; then
  if [ $genb_s5 = 1 ] || [ $genb_s5 = 2 ] || [ $genb_s5 = 3 ] || [ $genb_s5 = 4 ] || [ $genb_s5 = 6 ] || [ $genb_s5 = 8 ] || [ $genb_s5 = 9 ] || [ $genb_s5 = 15 ]; then
echo $kyonameb5"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $genb_6 = 1 ]; then
  if [ $genb_s6 = 1 ] || [ $genb_s6 = 2 ] || [ $genb_s6 = 3 ] || [ $genb_s6 = 4 ] || [ $genb_s6 = 6 ] || [ $genb_s6 = 8 ] || [ $genb_s6 = 9 ] || [ $genb_s6 = 15 ]; then
echo $kyonameb6"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $genb_7 = 1 ]; then
  if [ $genb_s7 = 1 ] || [ $genb_s7 = 2 ] || [ $genb_s7 = 3 ] || [ $genb_s7 = 4 ] || [ $genb_s7 = 6 ] || [ $genb_s7 = 8 ] || [ $genb_s7 = 9 ] || [ $genb_s7 = 15 ]; then
echo $kyonameb7"でスポーツ中継あり" >> $textfilenotify
  fi
fi
if [ $genb_8 = 1 ]; then
  if [ $genb_s8 = 1 ] || [ $genb_s8 = 2 ] || [ $genb_s8 = 3 ] || [ $genb_s8 = 4 ] || [ $genb_s8 = 6 ] || [ $genb_s8 = 8 ] || [ $genb_s8 = 9 ] || [ $genb_s8 = 15 ]; then
echo $kyonameb8"でスポーツ中継あり" >> $textfilenotify
  fi
fi

resvname=$(curl -s $epgstation_url"api/reserves?offset=0&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.name]')
resvstart=$(curl -s $epgstation_url"api/reserves?offset=0&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.startAt]' | cut -c 2- |  rev | cut -c 5- | rev)
resvrzantime=$((($resvstart-$timenow)/3600))
resvstart2=$(echo $(date "+%Y-%m-%d_%H:%M" -d @$resvstart))
resvchnl=$(curl -s $epgstation_url"api/reserves?offset=0&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | .channelId')
resvchnl2="."
case "$resvchnl" in
  3240222544 ) resvchnl2="RAB" ;;
  3240122536 ) resvchnl2="NHKE" ;;
  3240022528 ) resvchnl2="NHKG" ;;
  3240422560 ) resvchnl2="ABA" ;;
  3240322552 ) resvchnl2="ATV" ;;
  400101 ) resvchnl2="NHKBS1" ;;
  400103 ) resvchnl2="NHKBSP" ;;
  400141 ) resvchnl2="BS日テレ" ;;
  400151 ) resvchnl2="BS朝日" ;;
  400161 ) resvchnl2="BS_TBS" ;;
  400171 ) resvchnl2="BSテレ東" ;;
  400181 ) resvchnl2="BSフジ" ;;
  400211 ) resvchnl2="BS11" ;;
  400222 ) resvchnl2="BS12" ;;
esac
echo "予約01:"$resvchnl2","$resvrzantime"時間後,"$resvstart2"、"${resvname:2:30} >> $textfilenotify

resvname=$(curl -s $epgstation_url"api/reserves?offset=1&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.name]')
resvstart=$(curl -s $epgstation_url"api/reserves?offset=1&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.startAt]' | cut -c 2- |  rev | cut -c 5- | rev)
resvrzantime=$((($resvstart-$timenow)/3600))
resvstart2=$(echo $(date "+%Y-%m-%d_%H:%M" -d @$resvstart))
resvchnl=$(curl -s $epgstation_url"api/reserves?offset=1&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | .channelId')
resvchnl2="."
case "$resvchnl" in
  3240222544 ) resvchnl2="RAB" ;;
  3240122536 ) resvchnl2="NHKE" ;;
  3240022528 ) resvchnl2="NHKG" ;;
  3240422560 ) resvchnl2="ABA" ;;
  3240322552 ) resvchnl2="ATV" ;;
  400101 ) resvchnl2="NHKBS1" ;;
  400103 ) resvchnl2="NHKBSP" ;;
  400141 ) resvchnl2="BS日テレ" ;;
  400151 ) resvchnl2="BS朝日" ;;
  400161 ) resvchnl2="BS_TBS" ;;
  400171 ) resvchnl2="BSテレ東" ;;
  400181 ) resvchnl2="BSフジ" ;;
  400211 ) resvchnl2="BS11" ;;
  400222 ) resvchnl2="BS12" ;;
esac
echo "予約02:"$resvchnl2","$resvrzantime"時間後,"$resvstart2"、"${resvname:2:30} >> $textfilenotify

resvname=$(curl -s $epgstation_url"api/reserves?offset=2&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.name]')
resvstart=$(curl -s $epgstation_url"api/reserves?offset=2&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.startAt]' | cut -c 2- |  rev | cut -c 5- | rev)
resvrzantime=$((($resvstart-$timenow)/3600))
resvstart2=$(echo $(date "+%Y-%m-%d_%H:%M" -d @$resvstart))
resvchnl=$(curl -s $epgstation_url"api/reserves?offset=2&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | .channelId')
resvchnl2="."
case "$resvchnl" in
  3240222544 ) resvchnl2="RAB" ;;
  3240122536 ) resvchnl2="NHKE" ;;
  3240022528 ) resvchnl2="NHKG" ;;
  3240422560 ) resvchnl2="ABA" ;;
  3240322552 ) resvchnl2="ATV" ;;
  400101 ) resvchnl2="NHKBS1" ;;
  400103 ) resvchnl2="NHKBSP" ;;
  400141 ) resvchnl2="BS日テレ" ;;
  400151 ) resvchnl2="BS朝日" ;;
  400161 ) resvchnl2="BS_TBS" ;;
  400171 ) resvchnl2="BSテレ東" ;;
  400181 ) resvchnl2="BSフジ" ;;
  400211 ) resvchnl2="BS11" ;;
  400222 ) resvchnl2="BS12" ;;
esac
echo "予約03:"$resvchnl2","$resvrzantime"時間後,"$resvstart2"、"${resvname:2:30} >> $textfilenotify

resvname=$(curl -s $epgstation_url"api/reserves?offset=3&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.name]')
resvstart=$(curl -s $epgstation_url"api/reserves?offset=3&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.startAt]' | cut -c 2- |  rev | cut -c 5- | rev)
resvrzantime=$((($resvstart-$timenow)/3600))
resvstart2=$(echo $(date "+%Y-%m-%d_%H:%M" -d @$resvstart))
resvchnl=$(curl -s $epgstation_url"api/reserves?offset=3&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | .channelId')
resvchnl2="."
case "$resvchnl" in
  3240222544 ) resvchnl2="RAB" ;;
  3240122536 ) resvchnl2="NHKE" ;;
  3240022528 ) resvchnl2="NHKG" ;;
  3240422560 ) resvchnl2="ABA" ;;
  3240322552 ) resvchnl2="ATV" ;;
  400101 ) resvchnl2="NHKBS1" ;;
  400103 ) resvchnl2="NHKBSP" ;;
  400141 ) resvchnl2="BS日テレ" ;;
  400151 ) resvchnl2="BS朝日" ;;
  400161 ) resvchnl2="BS_TBS" ;;
  400171 ) resvchnl2="BSテレ東" ;;
  400181 ) resvchnl2="BSフジ" ;;
  400211 ) resvchnl2="BS11" ;;
  400222 ) resvchnl2="BS12" ;;
esac
echo "予約04:"$resvchnl2","$resvrzantime"時間後,"$resvstart2"、"${resvname:2:30} >> $textfilenotify

resvname=$(curl -s $epgstation_url"api/reserves?offset=4&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.name]')
resvstart=$(curl -s $epgstation_url"api/reserves?offset=4&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | [.startAt]' | cut -c 2- |  rev | cut -c 5- | rev)
resvrzantime=$((($resvstart-$timenow)/3600))
resvstart2=$(echo $(date "+%Y-%m-%d_%H:%M" -d @$resvstart))
resvchnl=$(curl -s $epgstation_url"api/reserves?offset=4&limit=1&type=normal&isHalfWidth=true" | jq -c '.reserves[] | .channelId')
resvchnl2="."
case "$resvchnl" in
  3240222544 ) resvchnl2="RAB" ;;
  3240122536 ) resvchnl2="NHKE" ;;
  3240022528 ) resvchnl2="NHKG" ;;
  3240422560 ) resvchnl2="ABA" ;;
  3240322552 ) resvchnl2="ATV" ;;
  400101 ) resvchnl2="NHKBS1" ;;
  400103 ) resvchnl2="NHKBSP" ;;
  400141 ) resvchnl2="BS日テレ" ;;
  400151 ) resvchnl2="BS朝日" ;;
  400161 ) resvchnl2="BS_TBS" ;;
  400171 ) resvchnl2="BSテレ東" ;;
  400181 ) resvchnl2="BSフジ" ;;
  400211 ) resvchnl2="BS11" ;;
  400222 ) resvchnl2="BS12" ;;
esac
echo "予約05:"$resvchnl2","$resvrzantime"時間後,"$resvstart2"、"${resvname:2:30} >> $textfilenotify
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?