Create a gist now

Instantly share code, notes, and snippets.

@manavix /nhkfmrec.sh
Last active Dec 23, 2015

[Raspbian]らじる★らじる(NHKネットラジオ)録音スクリプト
#!/bin/sh
XDATE=`date +"%Y-%m%d-%H%M"`
STOPMINS=${1:-3}
STOPSECS=`expr ${STOPMINS} \* 60 + 30`
SAVEDIR=~
FLVFILE=${SAVEDIR}/NHK-FM_${XDATE}.flv
MP3FILE=${FLVFILE%.flv}.mp3
rtmpdump --rtmp "rtmpe://netradio-fm-flash.nhk.jp" \
--playpath 'NetRadio_FM_flash@63343' \
--app "live" \
-W http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf \
--live \
-B $STOPSECS \
-o ${FLVFILE}
ffmpeg -loglevel quiet -y -i ${FLVFILE} -vn -acodec libmp3lame -ab 128k ${MP3FILE}
if [ $? = 0 ]; then
rm -f ${FLVFILE}
fi
exit 0
@manavix
Owner
manavix commented Sep 23, 2013
  • 時間指定は分で。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment