#!/bin/bash
url="http://dreammedia.ru"
username=`whoami`
path="/home/$username"
input="$path/playlist.xml"
output="$path/playlist.txt"
read -p 'Enter name of band you want to download: ' band
echo
read -p 'Enter name of Album, include space if it has: ' album
playlist="http://dreammedia.ru/playlist/$band/$album/playlist.xml"
wget -O $input "$playlist"
if test ! -s $input
then
echo 'Cannot get playlist, sorry!'
rm -f $path/playlist.xml
exit 1
else
echo 'Got it'
echo 'Start this game'
touch $output
cat $input | awk -F '[<>]' '/mp3/{print $3}' | sed 's/\ /%20/g'> $output
fi
for i in `more $output`
do
echo Downloading
wget "$url$i"
done
exit 0
Chỉ có thế, ko có gì nói thêm :-D