All pastes #2074856 Raw Edit

goear

public shellscript v1 · immutable
#2074856 ·published 2011-06-05 03:35 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`case $1 in  '-l')    echo -e "Reproduciendo:  \033[38;5;148m$artist-$title ...\033[39m"    mplayer $mp3url;;   '-d')    #wget $mp3url -O "$artist-$title.mp3"    axel -a -n 10 $mp3url --output="$artist-$title.mp3"    echo -e "Archivo descargado como: \033[38;5;148m$artist-$title.mp3\033[39m";;  '--help')    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";;  *)    echo "Error, use goear-script --help para ayuda";;esac