手抜き版

ワンライナー

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の配信URL一覧の取得: ∵なっから∴今日のラヂヲ からステーションIDを取得

以前の 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

ステーションID毎に配信サーバ情報を取得するコマンドを生成し、parallel で並列処理

while read -r station id; do
  echo "配信サーバ情報のxmlを取得し、パースするコマンド";
done | parallel

前述「配信サーバ情報のxmlを取得し、パースするコマンド」

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

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-04-12 (火) 01:26:11