fmstream で afn を検索した結果を編集します
AFNP(AFN Pacific)のほか、AFNE(AFN Europe)、AFN(Pacific/Europe Eagle以外)も取得出来ます
$ curl -sSL 'http://fmstream.org/index.php?s=afn' | grep -oE "[^']+AFN[^']+\.(mp3|aac)" | sed 's/\\//g; s#^#http://#'
http://20723.live.streamtheworld.com/AFNE_VIC.mp3 http://20723.live.streamtheworld.com:3690/AFNE_VIC.mp3 http://23603.live.streamtheworld.com/AFNE_VIC.mp3 http://23603.live.streamtheworld.com:3690/AFNE_VIC.mp3 http://25533.live.streamtheworld.com/AFNE_VIC.mp3 http://25533.live.streamtheworld.com:3690/AFNE_VIC.mp3 http://25583.live.streamtheworld.com:3690/AFNE_VICAAC.aac http://20853.live.streamtheworld.com/AFNE_VICAAC.aac http://20853.live.streamtheworld.com:3690/AFNE_VICAAC.aac http://20423.live.streamtheworld.com/AFNE_VICAAC.aac ...
以前のバージョン sh/ネタ/AFN配信URL_v1 をベースに、最近のURL変更に対応させたものです
3690/tcp や .aac は除外しています
$ curl -sSL http://nakkara.cocolog-nifty.com/nakkara/2021/04/post-1d1379.html | grep -oE '[A-Z][a-zA-Z ]+=AFN.?_[A-Z]+' | sed 's/ /_/g;s/=/ /' | while read -r station id; do echo "curl -sSL 'https://playerservices.streamtheworld.com/api/livestream?station=$id&version=1.8' | xmlstarlet sel -N x=http://provisioning.streamtheworld.com/player/livestream-1.8 -t -m '//x:port[text()=80]' -v @type -o :// -v ../../x:ip -o '/$id.mp3' -n"; done | parallel
http://25583.live.streamtheworld.com/AFNP_SBO.mp3 http://20853.live.streamtheworld.com/AFNP_SBO.mp3 ... http://18723.live.streamtheworld.com/AFNP_SBO.mp3 http://19803.live.streamtheworld.com/AFNP_CSY.mp3 http://18393.live.streamtheworld.com/AFNP_CSY.mp3 ...
以前の AFN 360 Internet Radio はURL変更により使えなくなりました。。。
curl -sSL http://nakkara.cocolog-nifty.com/nakkara/2021/04/post-1d1379.html |
grep -oE '[A-Z][a-zA-Z ]+=AFN.?_[A-Z]+' |
sed 's/ /_/g;s/=/ /' |
最後の sed で後続の read の準備をしています
使用前 station(空白含む)=id 使用後 station(アンダースコアつなぎ)[半角空白]id
while read -r station id; do
echo "配信サーバ情報のxmlを取得し、パースするコマンド";
done | parallel
curl -sSL 'https://playerservices.streamtheworld.com/api/livestream?station=$id&version=1.8' |
xmlstarlet sel \
-N x=http://provisioning.streamtheworld.com/player/livestream-1.8 \
-t \
-m '//x:port[text()=80]' \
-v @type -o :// -v ../../x:ip -o '/$id.mp3' -n