curl -sSL https://www.afnpacific.net/afn-360/ | grep -woE 'AFNP?_[A-Z]+' | while read -r afnID; do (curl -sSL "https://playerservices.streamtheworld.com/api/livestream?transport=http&version=1.8&station=$afnID" | xmllint --xpath "//*[local-name()='mountpoints']" - | xmllint --xpath '//server[last()]/ip/text() | //mount/text()' - &); done | paste - - | awk '{printf "http://%s/%s.%s\n", $1, $2, /AAC$/ ? "aac" : "mp3"}' | sort -t/ -k4,4
http://19793.live.streamtheworld.com/AFNP_DGU.mp3 http://14613.live.streamtheworld.com/AFNP_DGUAAC.aac http://19213.live.streamtheworld.com/AFNP_IWA.mp3 http://14943.live.streamtheworld.com/AFNP_IWAAAC.aac http://23603.live.streamtheworld.com/AFNP_KSN.mp3 http://19213.live.streamtheworld.com/AFNP_KSNAAC.aac http://18393.live.streamtheworld.com/AFNP_MSW.mp3 http://19213.live.streamtheworld.com/AFNP_MSWAAC.aac http://17853.live.streamtheworld.com/AFNP_OKN.mp3 http://21233.live.streamtheworld.com/AFNP_OKNAAC.aac http://19793.live.streamtheworld.com/AFNP_OSN.mp3 http://14613.live.streamtheworld.com/AFNP_OSNAAC.aac http://20853.live.streamtheworld.com/AFNP_SBO.mp3 http://19213.live.streamtheworld.com/AFNP_SBOAAC.aac http://18393.live.streamtheworld.com/AFNP_TKO.mp3 http://22343.live.streamtheworld.com/AFNP_TKOAAC.aac http://19793.live.streamtheworld.com/AFN_CTYP.mp3 http://17963.live.streamtheworld.com/AFN_CTYPAAC.aac http://16813.live.streamtheworld.com/AFN_FAN.mp3 http://24503.live.streamtheworld.com/AFN_FANAAC.aac http://18393.live.streamtheworld.com/AFN_FREP.mp3 http://18393.live.streamtheworld.com/AFN_FREPAAC.aac http://14103.live.streamtheworld.com/AFN_GRV.mp3 http://13743.live.streamtheworld.com/AFN_GRVAAC.aac http://16693.live.streamtheworld.com/AFN_HOTP.mp3 http://15373.live.streamtheworld.com/AFN_HOTPAAC.aac http://20423.live.streamtheworld.com/AFN_JOEP.mp3 http://22723.live.streamtheworld.com/AFN_JOEPAAC.aac http://18683.live.streamtheworld.com/AFN_LGYP.mp3 http://18683.live.streamtheworld.com/AFN_LGYPAAC.aac http://18393.live.streamtheworld.com/AFN_PTK.mp3 http://17343.live.streamtheworld.com/AFN_PTKAAC.aac http://16603.live.streamtheworld.com/AFN_VCE.mp3 http://14983.live.streamtheworld.com/AFN_VCEAAC.aac
AFN東京(aacで配信)を再生する
ffplay http://22343.live.streamtheworld.com/AFNP_TKOAAC.aac
curl -sSL https://www.afnpacific.net/afn-360/ | grep -woE 'AFNP?_[A-Z]+' |
while read -r afnID; do
curl -sSL "https://playerservices.streamtheworld.com/api/livestream?transport=http&version=1.8&station=$afnID" |
(xmlパース処理が続く)
...
done |
while read ...
xmllint --xpath "//*[local-name()='mountpoints']" - |
xmllint --xpath '//server[last()]/ip/text() | //mount/text()' - ;
done |
paste - - | awk '{printf "http://%s/%s.%s\n", $1, $2, /AAC$/ ? "aac" : "mp3"}'
大体 30秒 -> 5秒程度に短縮できる
curl -sSL https://www.afnpacific.net/afn-360/ |
grep -woE 'AFNP?_[A-Z]+' |
while read -r afnID; do
(
curl -sSL "https://playerservices.streamtheworld.com/api/livestream?transport=http&version=1.8&station=$afnID" |
xmllint --xpath "//*[local-name()='mountpoints']" - |
xmllint --xpath '//server[last()]/ip/text() //mount/text()' -
&);
done |
paste - - |
awk '{printf "http://%s/%s.%s\n", $1, $2, /AAC$/ ? "aac" : "mp3"}' |
sort -t/ -k4,4
Linuxで「AFN」を聞くスクリプト – キクチラヂヲ堂
AFN 360の配信URL一覧の取得: ∵なっから∴今日のラヂヲ