5 messages in com.googlegroups.google-picasa-data-api[PWA API] Re: can't upload to album c...| From | Sent On | Attachments |
|---|---|---|
| Brett | 15 Jun 2008 13:46 | |
| Jeff Fisher (Google) | 15 Jun 2008 21:28 | |
| Brett | 16 Jun 2008 10:34 | |
| sansbacon | 17 Jul 2008 12:59 | |
| Jeff Fisher | 21 Jul 2008 13:00 |
| Subject: | [PWA API] Re: can't upload to album created with python API![]() |
|---|---|
| From: | Brett (bret...@gmail.com) |
| Date: | 06/16/2008 10:34:44 AM |
| List: | com.googlegroups.google-picasa-data-api |
Using the albumID of the newly created album seems to do the trick.
Thanks.
On Jun 15, 10:28 pm, "Jeff Fisher (Google)" <api....@google.com> wrote:
Hi,
This is probably the case sensitivity bug, so if someone types 'test' into your program the album name would actually be 'Test' or sometimes 'Test1', etc if the album already exists. Can you try extracting the <gphoto:id> element of the entry you get back when creating the album and changing your URI to be ''/data/feed/api/user/default/albumid/ %s' (where %s is to be replaced with the album id).
Cheers, -Jeff
On Jun 16, 6:47 am, Brett <bret...@gmail.com> wrote:
I get a the following error when I try to upload photos into an album I created with gdata.photos.service.PhotoService.InsertAlbum:
gdata.photos.service.GooglePhotosException: (404, 'Not Found', 'No album found.')
I don't get this error when I use the same script to upload into an album that I created from the PicasaWeb web page. Also, if I visit PicasaWeb I can see my album listed with the other albums and can even import using the web interface but still can't upload with the Python Picasa Web Albums Data API.
Am I doing something horribly wrong? Below is the test scripts:
from getpass import getpass import mimetypes from optparse import OptionParser
import gdata.photos.service import gdata.media import gdata.geo
parser = OptionParser() parser.add_option('-e', "--email", dest="email", metavar="EMAIL", default=None, help='the email address used to login to Picasa Web') parser.add_option("-p", "--password", dest="password", metavar="PASSWORD", default=None, help='the password used to login to Picasa') parser.add_option("-a", "--album", dest="album", metavar="ALBUM", default=None, help='the album to upload to')
options, args = parser.parse_args()
if not options.email: options.email = raw_input('email: ') if not options.password: options.password = getpass('password: ') if not options.album: options.album = raw_input('album: ')
gd_client = gdata.photos.service.PhotosService() gd_client.email = options.email gd_client.password = options.password gd_client.source = 'test' gd_client.ProgrammaticLogin()
albums = [entry.title.text for entry in gd_client.GetUserFeed().entry] if options.album not in albums: entry = gd_client.InsertAlbum(title=options.album, access='private', summary="") uri = '/data/feed/api/user/default/album/%s' % options.album for filename in args: content_type = mimetypes.guess_type(filename)[0] title = filename summary = '' gd_client.InsertPhotoSimple(uri, title, summary, filename, content_type=content_type)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Picasa Web Albums API" group.
To post to this group, send email to Goog...@googlegroups.com
To unsubscribe from this group, send email to
Goog...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Google-Picasa-Data-API?hl=en
-~----------~----~----~----~------~----~------~--~---




