Notices


Reply
Thread Tools
Posts: 30 | Thanked: 4 times | Joined on Nov 2009
#1
Goear is a music website where you can listen to a lot of tracks for free...

i modified someone else's script to download and/or play streaming mp3 from this source.

files here, updated: 2011-12-28
update: goear changed to friendly urls

you will need to have already installed bash, wget & mplayer

Last edited by pulketo; 2011-12-28 at 22:31. Reason: notes
 

The Following User Says Thank You to pulketo For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#2
Can you winzip your script?

I think I somehow copied and pasted this wrong.


/usr/bin/music: line 7: *: command not found
/usr/bin/music: line 8: *: command not found
/usr/bin/music: line 9: *: command not found
/usr/bin/music: line 10: *: command not found
/usr/bin/music: line 21: *: command not found
/usr/bin/music: line 25: *: command not found
/usr/bin/music: line 26: *: command not found
/usr/bin/music: line 28: *: command not found
/usr/bin/music: line 30: wget: command not found
/usr/bin/music: line 31: *: command not found
grep: /tmp/17397-titulos.txt: No such file or directory


I have an older N800 by the way.
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#3
This is what I have...


#!/bin/bash
# example: goear corey+sunglasses+at+night
# author: at least 3 bash coders
#Si el usuario no pone lo que busca en la linea de comandos, se lo pedimos.
##################
if [ -z "$1" ]; then
* * * * echo "Sintaxis:"
* * * * echo " * *$0 <artist+word1+word2>"
* * * * echo * * *Note: Argument must be plus\(+\) separated or between \"\"
* * * * exit
fi
##################
tmpdir=/tmp
prefix=$RANDOM
SEARCH=$tmpdir/$prefix-titulos.txt
CANCIONES=$tmpdir/$prefix-canciones.txt
ENLACES=$tmpdir/$prefix-enlaces.txt
TITULOS=$tmpdir/$prefix-titulos.txt
TODOWNLOAD=$tmpdir/$prefix-download.txt
##################
*
if [ $1 ]; then
* * * * TITULO="$@"
else
* * * * echo "Title and Artist:"
* * * * read TITULO
fi
*
#Descargamos el PHP correspondiente al título.
wget http://goear.com/search.php?q="$TITULO" -O $SEARCH
*
#line number containing links is always changing so looking for a pattern
head -$(grep -i -n -e 'ventana independiente' $SEARCH | cut -d ":" -f 1) $SEARCH | tail -1 > $CANCIONES
*
#Mediante ER, obtenemos una lista de canciones y una lista de enlaces.
#By using RegExp... we get song list and links
egrep -o 'listen/......./[^"]*' $CANCIONES > $ENLACES
egrep -o '"Escuchar[^"]*' $CANCIONES | grep -v 'en una ventana independiente' > $TITULOS
*
#Mostramos al usuario los que ha encontrado en la primera página.
Linea=1
cat $TITULOS | while read line;
* * * * do {
* * * * * * * * echo $Linea: ${line:9}
* * * * * * * * let 'Linea += 1'
* * * * }
* * * * done
*
#Si no encuentra nada, sale.
CONDICION=`wc -l $TITULOS | awk '{print $1}'`
if [ $CONDICION == 0 ]; then
* * * * echo "No hay resultados. Prueba buscando otra cosa."
* * * * rm -f $SEARCH $CANCIONES $ENLACES $TITULOS
* * * * exit
fi
*
#Leemos qué canción quiere el usuario bajarse.
echo "¿Cuál te quieres bajar? Indica el número: (0 para Cancelar)"
read NUMERO
*
#Cero para Cancelar
if [ $NUMERO = 0 ]; then
* * * * rm -f $SEARCH $CANCIONES $ENLACES $TITULOS
* * * * echo "Hasta pronto."
* * * * exit
fi
*
#Concatenamos http://www.goear.com con el contenido de aBajar.txt.
#PD: Alguien sabe hacerlo de manera más sencilla?
GOEAR=http://www.goear.com/
head -$NUMERO $ENLACES | tail -1 > $TODOWNLOAD
for LISTEN in `cat $TODOWNLOAD`
do
* * * * ENLACE=${GOEAR}${LISTEN}
done
echo $ENLACE
*
#A partir de aquí el script no es mío, pero es muy sencillo de leer.
fileid=`echo $ENLACE | cut -d '/' -f 5`
xmlurl="http://www.goear.com/tracker758.php?f="$fileid
infoline=`wget -qO- $xmlurl | grep ".mp3"`
mp3url=`echo $infoline | cut -d '"' -f6`
artist=`echo $infoline | cut -d '"' -f10`
title=`echo $infoline | cut -d '"' -f12`
rm -f $SEARCH $CANCIONES $ENLACES $TITULOS $TODOWNLOAD
wget $mp3url -O "$artist"_-_"$title.mp3"
#mplayer -cache 1024 -softvol -softvol-max 1000 $mp3url
 
Posts: 30 | Thanked: 4 times | Joined on Nov 2009
#4
 

The Following User Says Thank You to pulketo For This Useful Post:
Posts: 1,048 | Thanked: 1,127 times | Joined on Jan 2010 @ Amsterdam
#5
@Addison

Clean out the code by removing the unwanted characters that have been copy/pasted by accident (the * characters, that is) and the code will run fine, be it slow.

Edit: Oh, and make sure you have wget installed.

Last edited by anthonie; 2011-12-22 at 00:53. Reason: Oversaw the wget error in post I reacted to
 

The Following User Says Thank You to anthonie For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#6
Neat script.

Thank you.

I've tried 4 different artists, but for each of them, there was only one song available to choose from.

Also, the audio quality was fairly low, maybe at best, a constant 160 kbps.

Still cool though downloading from Xterm.

Last edited by Addison; 2011-12-22 at 07:14. Reason: stupid typing
 
Posts: 30 | Thanked: 4 times | Joined on Nov 2009
#7
that site is mainly for spanish speakers, let's make it global, upload your music www.goear.com

Originally Posted by Addison View Post
Neat script.

Thank you.

I've tried 4 different artist, but for each of them, there was only one song available to choose from.

Also, the audio quality was fairly low, maybe at best, a constant 160 kbps.

Still cool though downloading from Xterm.
 

The Following User Says Thank You to pulketo For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#8
I'd rather take than give when it comes to music.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 07:59.