Thursday, March 6, 2008

Album downloader on TVShark.net

baTakes one argument, the URL of the first image in the album.
#!/bin/bash

n=`echo "$1" | awk -F "=|&" '{print tolower($2)}' | sed 's/+/_/g'`
m=`echo "$1" | awk -F "=|&" '{print $6}'`
l=`echo "$1" | awk -F "=|&" '{print $8}'`

if [ "$l" -eq "0" ]
then
t=""
else
t="_lg"
fi

ii=`seq 1 $m`
for i in $ii
do
url="http://www.tvshark.com/imgs/c/${n}${i}${t}.jpg"
wget -nv $url
done