Quickly Download Entire PicasaWeb Albums

Picasa Albums are nice to store and share the photos we take.
It gives a nice interface to view all the photos as slideshow and html albums.

We like to see photos and mostly would like to save them.
But we can download them as individual photos only.
Picasa does not give a way to download the entire album.

Downloading individual photos is hectic.

It would be so nice, if we can download the entire picasa albums.

Is there any way?

Linux gives the answer.

A small shell script can do this.

I take this script from
http://blue-gnu.biz/content/bash_script_quickly_download_entire_picasaweb_albums

Here is the script:

#!/bin/bash
# Distributed under the terms of the GNU General Public License v3 or later
# AUTHOR: Loïc Cerf
# e-mail: magicbanana@gmail.com
WGET_OPT="-q -T 180 -t 3 -c"
EX_USAGE=64
EX_NOHOST=68
if [ -z "$1" -o "$1" = "--help" -o "$1" = "-h" ]
then
echo "Usage: $0 url [destination]"
exit
fi
page=${1#*picasaweb.google.*/}
if [ "$page" = "$1" ]
then
echo "\"$1\" is not the URL of a PicasaWeb album or gallery" 1>&2
exit $EX_USAGE
fi
temp=`mktemp`
if wget $WGET_OPT -O $temp "$1"
then
finalPage=${page#*/}
if [ -z "$finalPage" -o "$finalPage" = "$page" ]
then
# $temp is a gallery
if [ -z "$2" ]
then
destination=`grep -m 1 "^var _user" $temp`
destination=${destination##*nickname:\"}
set "$1" "${destination%%\"*}"
fi
mkdir -p "$2"
cd "$2"
grep -E -o "$1"[/]?[[:alnum:]:.%~_-]+ $temp | sort | uniq |
while read album
do
"$0" $album &
done
else
# $temp is an album
if [ -z "$2" ]
then
destination=`grep -m 1 "^var _album" $temp`
destination=${destination##*title:\"}
set "$1" "${destination%%\"*}"
fi
grep -E -o {id:\"[0-9]+\",s:\"[[:alnum:]:\\.%~_-]+ $temp |
while read picture
do
picture=${picture##*\"}
picture=${picture/\x2Fs144/}
wget $WGET_OPT -P "$2" ${picture//\x2F//} &
done
fi
else
exit $EX_NOHOST
fi
rm $temp

save this script as “picasaweb-download”

Make it executable:

chmod a+x picasaweb-download

Using this script is very easy:

picasaweb-download URL [destination]


Example:

$ ./picasaweb-download   http://picasaweb.google.com/tshrinivasan/ShriniBirthday08
 
It will download all the photos from the album and put them in a new folder named “ShriniBirthday08”. i.e. the album name.

Now I enjoy downloading all the picasaweb albums.

Thanks  to Loïc Cerf <magicbanana AT gmail DOT com> for this wonderful script.

Powered by ScribeFire.

2 thoughts on “Quickly Download Entire PicasaWeb Albums

  1. There is an alternative option to this, if you download ‘Picasa for Linux’ and install it, the latest version 2.7 has the option to download the whole web album, you just need to enter the URL.

  2. Just to mention that I had to remove the ‘if [ “$page” = “$1” ]’ as it was triggering either way (maybe now that Picasa defaults to https ?). Worked fine once I took away this safety…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s