Skip to content

Instantly share code, notes, and snippets.

@sucotronic
Created July 31, 2013 13:40
Show Gist options
  • Save sucotronic/6122072 to your computer and use it in GitHub Desktop.
Save sucotronic/6122072 to your computer and use it in GitHub Desktop.
reproductor de radio online de m80
#!/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
@sucotronic
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment