Register
It is currently Sun Dec 21, 2014 7:02 am

GoEar download


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Sat Oct 11, 2008 4:03 am   

Joined: Sat Oct 11, 2008 4:01 am
Posts: 1
Location: ar
I'm sleepless so I wrote this script, hope someone like it

Code:
#!/bin/bash
echo Please, enter song id
read SONGID
echo Ok, looking for song path...
wget -nv http://www.goear.com/files/xmlfiles/${SONGID:0:1}/secm$SONGID.xml
if [ ! -f secm$SONGID.xml ]
then
echo Song does not exists
else
echo Downloading song...
SONGPATH=`grep -o "http://.*mp3" secm$SONGID.xml`
wget $SONGPATH
echo Download has finished
fi
rm -f secm$SONGID.xml


Top
 Profile WWW  
 PostPosted: Wed Dec 31, 2008 8:17 pm   

Joined: Wed Dec 31, 2008 8:09 pm
Posts: 2
I automated this so all you have to do is paste in the link. Naming the mp3 and everything. :)

Code:
#!/bin/bash
#set -x

clear
echo "Please, enter song link"
read SONGID

wget $SONGID
SONGID="`echo $SONGID | cut -d= -f2`"
echo "Ok, going to download now..."

clear
wget -nv http://www.goear.com/files/xmlfiles/${SONGID:0:1}/secm$SONGID.xml

if [ ! -f secm$SONGID.xml ]
then
   echo "Hmm, can't find the song."
else
   echo "Downloading song..."
   SONGPATH=`grep -o "http://.*mp3" secm$SONGID.xml`
   SONGNAME=`echo $SONGPATH | cut -d/ -f6`
   SONGTITLE=`grep -m1 "<title>" listen.php\?v\=${SONGID}| cut -d'>' -f2 | cut -d'-' -f1,2 | sed 's/ /\ /g'`
   wget $SONGPATH
   echo "Download has finished! :-)"
fi


mv $SONGNAME "$SONGTITLE.mp3"
rm -f secm$SONGID.xml*
rm -f listen.php\?v\=${SONGID}*


Top
 Profile  
 PostPosted: Thu Jan 01, 2009 7:22 pm   

Joined: Wed Dec 31, 2008 8:09 pm
Posts: 2
Opps I didn't realize the download link wasn't static. Slight update, notice the mv at the bottom.

Code:
#!/bin/bash
#set -x

clear
echo "Please, enter song link"
read SONGID

wget $SONGID
SONGID="`echo $SONGID | cut -d= -f2`"
echo "Ok, going to download now..."

clear
wget -nv http://www.goear.com/files/xmlfiles/${SONGID:0:1}/secm$SONGID.xml

if [ ! -f secm$SONGID.xml ]
then
   echo "Hmm, can't find the song."
else
   echo "Downloading song..."
   SONGPATH=`grep -o "http://.*mp3" secm$SONGID.xml`
   SONGNAME=`echo $SONGPATH`
   SONGTITLE=`grep -m1 "<title>" listen.php\?v\=${SONGID}| cut -d'>' -f2 | cut -d'-' -f1,2 | sed 's/ /\ /g'`
   wget $SONGPATH
   echo "Download of \""$SONGTITLE"\" has finished! :-)"
fi


mv "${SONGNAME//*\/}" "$SONGTITLE.mp3"
rm -f secm$SONGID.xml*
rm -f listen.php\?v\=${SONGID}*


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP