Ich möchte eine große Anzahl von Bildern in Picassa bewegen. Ich habe keine Probleme beim Hochladen mit InsertPhotoSimple, aber ich möchte auch Metadaten hochladen und habe Probleme mit InsertPhoto. Kann mir jemand auf ein einfaches Beispiel hinweisen oder mir sagen, was ich falsch mache? HierEinfaches Beispiel zum Hochladen von Fotos in Google Picasa
ist, was ich habe jetzt:
#!/bin/python
import gdata.photos.service
import gdata.media
gd_client = gdata.photos.service.PhotosService()
gd_client.email = 'my_google_email'
gd_client.password = 'my_pass'
gd_client.source = 'my_source'
gd_client.ProgrammaticLogin()
album_url = '/data/feed/api/user/%s/albumid/%s' % ('default', 'default')
filename = 'myfile.jpg'
metadata = gdata.photos.PhotoEntry()
metadata.title = 'My Photo Title'
metadata.media.keywords = 'keyword1, keyword2, keyword3'
upload_photo = gd_client.InsertPhoto(album_url, metadata, filename, content_type='image/jpeg')
Aber wenn ich diese laufen, Drosseln es jedes Mal mit: Traceback (jüngste Aufforderung zuletzt): File "./picassa.py", line 36, in? upload_photo = gd_client.InsertPhoto (album_url, Metadaten, Dateiname, content_type = 'image/jpeg') Datei "/home1/alptownc/public_html/photos/gdata-2.0.13/gdata/photos/service.py", Zeile 425 , in InsertPhoto Konverter = gdata.photos.PhotoEntryFromString) Datei "/home1/alptownc/public_html/photos/gdata-2.0.13/gdata/service.py", Zeile 1236, in Post media_source = media_source, Konverter = Konverter) Datei "/home1/alptownc/public_html/photos/gdata-2.0.13/gdata/service.py", Zeile 1286, in PostOrPut data_str = str (Daten) Datei "/ home1/alptownc/public_html/photos/gdata-2.0.13/atom/init .py ", Linie 377, in str return self.ToString() Datei "/home1/alptownc/public_html/photos/gdata-2.0.13/atom/ init .py", Zeile 374, in ToString return ElementTree.tostring (self._ToElementTree() , encoding = string_encoding) File "/home1/alptownc/public_html/photos/gdata-2.0.13/atom/ init Py", Linie 369, in _ToElementTree self._AddMembersToElementTree (new_tree)
ich weiß, Ich vermisse etwas Dummes und Einfaches, aber ich kann nicht sehen, was es ist. Danke