#!/bin/bash# The user must enter a target game directoryif [ -z "$1" ] ; then echo "usage: ./download_mp3s.sh [gamedir]where [gamedir] is the XXX:http://bluelaguna.net/music/XXX/mp3s.phpe.g../download_mp3s lodost" exit 1figamedir="$1"tmp_html='/tmp/html_data_slkdfj'wget -q -O $tmp_html "http://bluelaguna.net/music/$1/mp3s.php"sleep 1 # just making sure the wget output buffers are done... :|# This is the line that contains the MP3 links :)# p = print# q = quit# d = delete linelineout=`cat $tmp_html | sed -e '/rectangle/{p ; q}; d'`# Put each mp3 on its own linemp3junklist=`echo "$lineout" | sed -e 's/\.mp3/.mp3\n/g'`# Clean out the garbagemp3list=`echo -n "$mp3junklist" | sed -e '/\.mp3$/ {s,.*/\(.*\.mp3\)$,\1, ; s/+/%20/g ; p} ; d' | uniq`for i in $mp3list ; do target="http://delta.bluelaguna.net/$gamedir/$i" echo "Fetching: $target" wget -q $targetdone#http://delta.bluelaguna.net/lodost/*.mp3