SyntaxHighlighter

2010/03/03

How to Delete All Picasa Albums Programmatically

Google Apps HacksPicasa Web album doesn't provide us with the way to remove them at once on the web and the application.

I wrote a python script to clean up invalid albums at once.

Here is the script.

You should rewrite you google account and the password in the script. The script need to get the gdata client python library installed. If you don't make the library installed, please look at my former post.

And finally, please carefully note that THIS SCRIPT REMOVES ALL YOUR ALBUMS IN PICASA WEB ALBUM.
#!/usr/bin/env python

import sys

import gdata.photos.service
import gdata.media
import gdata.geo

gd_client = gdata.photos.service.PhotosService()
gd_client.email = 'GOOGLE_ACCOUNT'
gd_client.password = 'PASSWORD'
gd_client.source = 'exampleCo-exampleApp-1'
gd_client.ProgrammaticLogin()

albums = gd_client.GetUserFeed()
for album in albums.entry:
  print 'DELETE: title: %s, number of photos: %s, id: %s' % (album.title.text, album.numphotos.text, album.gphoto_id.text)
  gd_client.Delete(album)
  
sys.exit(0)

2 件のコメント:

匿名 さんのコメント...

Thank you! Wish this was an option in Picasa, or even on the web!

Unknown さんのコメント...

Thanks this works great still with Google+