All pastes #2054005 Raw Edit

goear-script

public shellscript v1 · immutable
#2054005 ·published 2011-05-04 23:23 UTC
rendered paste body
#!/bin/bashif [[ $1 != '-l' && $1 != '-d' && $1 != '--help' ]]then echo "Error, use goear-script --help para ayuda"fifileid=`echo $2 | cut -d '/' -f 5`xmlurl="http://www.goear.com/tracker758.php?f="$fileidinfoline=`wget -qO- $xmlurl | grep ".mp3"`mp3url=`echo $infoline | cut -d '"' -f6`artist=`echo $infoline | cut -d '"' -f10`title=`echo $infoline | cut -d '"' -f12`if [ $1 == '-l' ]then echo -e "Reproduciendo:  \033[38;5;148m$artist-$title ...\033[39m" mplayer $mp3urlfiif [ $1 == '-d' ]then wget $mp3url -O "$artist-$title.mp3" echo -e "Archivo descargado como: \033[38;5;148m$artist-$title.mp3\033[39m"fiif [ $1 == '--help' ]then echo "Ayuda de goear-script" echo "" echo "goear-script -l        Reproduce el archivo con Mplayer" echo "goear-script -d        Descarga el archivo" echo "goear-script --help    Muestra la ayuda" echo "" echo "Ejemplo para descargar: goear-script -d http://urldegoear"fi