######################################################################### # Script to download kannada 'Film songs' from http://www.udbhava.com # Tested with GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu) # To run type at the prompt: /bin/bash # # Copyright (C) 2007 Srivatsa Kanchi, R # License: GPL # ########################################################################## base_url="http://www.udbhava.com/udbhava" wget -o /dev/null -O- "${base_url}/albums.jsp?id=3" | \ grep -ioE '^\s*' | \ sed -re 's/.+id=([0-9]+)><.+>(.+)<\/font><\/a>/\1 \2/i' | \ while read ; do film=`echo $REPLY | cut -d' ' -f2-` echo "Film: $film" s_url="${base_url}/songs.jsp?id=`echo $REPLY | cut -d' ' -f1`" p_url="${base_url}/wax.jsp?" for i in `wget -o /dev/null -O- ${s_url} | \ grep -ioE 'type=checkbox.+value=[0-9]+>' | \ grep -ioE '[0-9][0-9][0-9][0-9]*'`; do p_url="${p_url}id=${i}&" done #Get the ASX file and fetch songs for the all entries wget -O- -o /dev/null ${p_url} | \ grep -ioE "http.+\.wma" | \ while read; do echo " fetching `echo "$REPLY" | \ sed -re 's/.+\/.+\-\s*(.+)\.wma/\1/'` ..." wget --quiet -N --directory-prefix="${film}" \ --user-agent="NSPlayer/4.1" "$REPLY" done done