Tuesday, May 22, 2007

script to download pictures from fotovagu.com






#!/bin/bash

echo "Albums 1)Maldivian Girls 2)Emme Reethi Bitun.(enter 1 or 2):"
read i
#varnoof pics is the no no pics in the album
case "$i" in
1)varnoofpics=4777;varalbum=1;;
2)varnoofpics=530;varalbum=2;;
*)exit
esac
echo -n "Enter username:"
read varusername
echo -n "password:"
read varpassword
wget --save-cookies=fotovagucookies --keep-session-cookies --post-data="username=${varusername}&password=${varpassword}&remember_me=checked&submitted=Login" -O pimpim http://www.fotovagu.com/gallery/login.php

varerror=`cat pimpim |grep -o "Couldn't log in"`
if [ "$varerror" == "Couldn't log in" ]
then
echo "Invalid username/password"
exit
else
echo "Username and Password accepted..continuing"
fi

wget --load-cookies=fotovagucookies --keep-session-cookies -O pimpim http://www.fotovagu.com/gallery/index.php

j=0



while (( $j<$varnoofpics ))
do


wget --load-cookies=fotovagucookies --keep-session-cookies -O pimpim "http://www.fotovagu.com/gallery/displayimage.php?album=${varalbum}&pos=${j}"

varpic=( `cat pimpim|grep -oE "albums\/userpics\/[0-9]+\/[A-Za-z0-9_-]+\.jpg"|grep -v thumb` )

wget --load-cookies=fotovagucookies --keep-session-cookies http://www.fotovagu.com/gallery/${varpic}

(( j++ ))

done

1 comment:

Ahmed XY said...

This comment can be use to download images from other websites?