Created
July 31, 2013 13:40
-
-
Save sucotronic/6122072 to your computer and use it in GitHub Desktop.
reproductor de radio online de m80
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NUM=0 | |
while [ $NUM -lt 10 ]; do | |
ARRAY=( `curl -s "http://playerservices.streamtheworld.com/api/livestream?version=1.5&mount=M80RADIOAAC&lang=es&nobuf=1373975014724" | sed 's% xmlns="http://provisioning.streamtheworld.com/player/livestream-1.5"%%' | xmllint --xpath "//server/@sid" - | sed 's/sid=//g' | sed 's/"//g' ` ) | |
N=`shuf --input-range=0-$(( ${#ARRAY[*]} - 1 )) | head -1` | |
mplayer -cache 200 -cache-min 50 http://${ARRAY[$N]}.live.streamtheworld.com/M80RADIOAAC | |
NUM=`expr $NUM + 1` | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Al igual que el reproductor web, descarga un xml con las fuentes, y prueba aleatoriamente con una de ellas. Si falla, espera 5 segundos, vuelve a descargar las fuentes y coge otra aleatoria.