sebastianw / gallery2picasa Goto Github PK
View Code? Open in Web Editor NEWUpload for Menalto Gallery2 to Google Picasa. Fork of the gallery2picasa Script from http://code.google.com/p/gallery2picasa/
Upload for Menalto Gallery2 to Google Picasa. Fork of the gallery2picasa Script from http://code.google.com/p/gallery2picasa/
For some albums it would be nice to merge the album into the main albums.
for this case it would be nice if it was posible to set an option -x nosubalbums -o true.-t "my new album name"
is that possible?
The script currently requires credentials for the database and for a Google account to be specified on the command line. This is insecure for two primary reasons:
ps -Af
on a linux machine.In general, the same reasons we don't want passwords in URLs apply here.
Perhaps it would be more reasonable to use a small settings file, or take the passwords interactively, or both. I'm happy to do this work myself, but please speak up if there are any requests about how it should be implemented.
I tried to figure out how to set the album thumbnail. As of today, without any success.
If someone knows how to update this metadata through g2data, I might be able to get this data out of gallery2 as well.
Here is some suggestions.
Is it possible to get a list of album in Gallery2 into a text file like this:
Summer party
Christmas
2007 pictures
and then run the script again with the new (edited) text file as a parameter.
This would make it possible to get a long list of albums edit the list of what you dont need and start the script up again without having to confirm every single album.
Google error: Entity too large!
CREATING Item [F:Billede 127.avi] [T:Billede 127] [S:Billede 127] [K:]
CREATING Item [F:MVI_0509.avi] [T:MVI_0509] [S:MVI_0509] [K:]
Google error: Entity too large!
CREATING Item [F:MVI_0512.avi] [T:MVI_0512] [S:MVI_0512] [K:]
CREATING Item [F:MVI_0589.avi] [T:MVI_0589] [S:MVI_0589] [K:]
CREATING Item [F:MVI_0591.avi] [T:MVI_0591] [S:MVI_0591] [K:]
Google error: Entity too large!
CREATING Item [F:MVI_0592.avi] [T:MVI_0592] [S:MVI_0592] [K:]
CREATING Item [F:MVI_0593.avi] [T:MVI_0593] [S:MVI_0593] [K:]
Google error: Entity too large!
CREATING Item [F:Nyt01_10 014.avi] [T:Nyt01.10 014] [S:Nyt01.10 014] [K:]
Traceback (most recent call last):
File "./gallery2picasa.py", line 225, in
main(sys.argv)
File "./gallery2picasa.py", line 197, in main
summary, filename, keywords=keywords, content_type=filetype)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 470, in InsertPhotoSimple
content_type)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 426, in InsertPhoto
converter=gdata.photos.PhotoEntryFromString)
File "/usr/lib/pymodules/python2.6/gdata/service.py", line 1235, in Post
media_source=media_source, converter=converter)
File "/usr/lib/pymodules/python2.6/gdata/service.py", line 1302, in PostOrPut
multipart[2]], headers=extra_headers, url_params=url_params)
File "/usr/lib/pymodules/python2.6/atom/init.py", line 92, in optional_warn_function
return f(_args, *_kwargs)
File "/usr/lib/pymodules/python2.6/atom/service.py", line 185, in request
data=data, headers=all_headers)
File "/usr/lib/pymodules/python2.6/gdata/auth.py", line 725, in perform_request
return http_client.request(operation, url, data=data, headers=headers)
File "/usr/lib/pymodules/python2.6/atom/http.py", line 169, in request
_send_data_part(data_part, connection)
File "/usr/lib/pymodules/python2.6/atom/http.py", line 358, in _send_data_part
connection.send(binarydata)
File "/usr/lib/python2.6/httplib.py", line 743, in send
self.sock.sendall(str)
File "/usr/lib/python2.6/ssl.py", line 203, in sendall
v = self.send(data[count:])
File "/usr/lib/python2.6/ssl.py", line 94, in
self.send = lambda data, flags=0: SSLSocket.send(self, data, flags)
File "/usr/lib/python2.6/ssl.py", line 174, in send
v = self._sslobj.write(data)
socket.error: [Errno 32] Broken pipe
It seems like if you have more video's that are too large for PWA the script crash.
it seems like google changed the limits if you signed up to google plus(video limit 15 mins)
Upload Album "Galleri - Uldum højskole - Efterår 2005 - Andre Billeder"? [y/N/a]n
Upload Album "Galleri - Rejser - Kleinwalsertal i østring"? [y/N/a]n
Upload Album "Galleri - Rejser - Erik og Henriette på tur. - Film"? [y/N/a]n
Upload Album "Galleri - Rejser - Lena og Anders på jordomrejse - Costa Rica"? [y/N/a]n
Upload Album "Galleri - Familie - Stormen på vitskøl"? [y/N/a]n
Upload Album "Galleri - Uldum højskole - Forår 2006"? [y/N/a]n
Upload Album "Galleri - Rejser - Erik og Henriette på tur. - Belize"? [y/N/a]n
Upload Album "Galleri - Rejser - Backpacker tur 2006 - Thailand"? [y/N/a]n
Upload Album "Galleri - Uldum højskole - Efterår 2005 - Anne k"? [y/N/a]n
Upload Album "Galleri - Uldum højskole - Efterår 2005 - Mie - 16,12,05"? [y/N/a]a
CREATING ALBUM [Galleri - Rejser - Erik og Henriette på tur. - Argentina] []
CREATING Item [F:IMG_5090.JPG] [T:Saa er vi paa city tur i Buens Aires.] [S:Saa er vi paa city tur i Buens Aires.] [K:]
CREATING Item [F:IMG_5091.JPG] [T:Museum.] [S:Museum.] [K:]
CREATING Item [F:IMG_5092.JPG] [T:Vatikanets ambassade i Argentina.] [S:Vatikanets ambassade i Argentina.] [K:]
^C
-0 option dosent work as it should, mismatch between selected album and actually uploaded albums.
seems the problem exists with both use of combinations n/y and /n/a
Hi it dosent look like the script creates a log file with all the skiped videos.
Google imposes a limit on the maximum number of items in an album:
http://picasa.google.com/support/bin/answer.py?answer=43879
Maximum number of photos and videos per web album: 1,000
Im not sure if this is an error or just how Webpicassa works, but all albums migrated get the date migrated insted of the date created in gallery2.
Traceback (most recent call last): File "./gallery2picasa.py", line 208, in main(sys.argv) File "./gallery2picasa.py", line 195, in main raise e gdata.photos.service.GooglePhotosException: (413, 'Request Entity Too Large', 'Video file size exceeds 104857600')
Hi.
It would be nice if the script could check for duplicates, so you can kind a resume your migration if something went wrong.
/sebastianw-gallery2picasa-7de09a6$ sudo ./gallery2picasa.py -b gallery -a xxxxxx.p -u [email protected] -p xxxxxxx -d gallery -g /var/www/gallery/g2data -y private -o false >> gallery.log
Traceback (most recent call last):
File "./gallery2picasa.py", line 215, in
main(sys.argv)
File "./gallery2picasa.py", line 151, in main
galbum = create_google_album(pws, album, privacy)
File "./gallery2picasa.py", line 71, in create_google_album
print strout.encode(sys.stdout.encoding, 'replace')
TypeError: encode() argument 1 must be string, not None
Im still getting the following error with the newst script, seems to bee if there is more that on too large file in a row
Google error: Entity too large!
CREATING Item [F:Billede 127.avi] [T:Billede 127] [S:Billede 127] [K:]
CREATING Item [F:MVI_0509.avi] [T:MVI_0509] [S:MVI_0509] [K:]
Google error: Entity too large!
CREATING Item [F:MVI_0512.avi] [T:MVI_0512] [S:MVI_0512] [K:]
CREATING Item [F:MVI_0589.avi] [T:MVI_0589] [S:MVI_0589] [K:]
CREATING Item [F:MVI_0591.avi] [T:MVI_0591] [S:MVI_0591] [K:]
Google error: Entity too large!
CREATING Item [F:MVI_0592.avi] [T:MVI_0592] [S:MVI_0592] [K:]
CREATING Item [F:MVI_0593.avi] [T:MVI_0593] [S:MVI_0593] [K:]
Google error: Entity too large!
CREATING Item [F:Nyt01_10 014.avi] [T:Nyt01.10 014] [S:Nyt01.10 014] [K:]
Traceback (most recent call last):
File "./gallery2picasa.py", line 225, in
main(sys.argv)
File "./gallery2picasa.py", line 197, in main
summary, filename, keywords=keywords, content_type=filetype)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 470, in InsertPhotoSimple
content_type)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 426, in InsertPhoto
converter=gdata.photos.PhotoEntryFromString)
File "/usr/lib/pymodules/python2.6/gdata/service.py", line 1235, in Post
media_source=media_source, converter=converter)
File "/usr/lib/pymodules/python2.6/gdata/service.py", line 1302, in PostOrPut
multipart[2]], headers=extra_headers, url_params=url_params)
File "/usr/lib/pymodules/python2.6/atom/init.py", line 92, in optional_warn_function
return f(_args, *_kwargs)
File "/usr/lib/pymodules/python2.6/atom/service.py", line 185, in request
data=data, headers=all_headers)
File "/usr/lib/pymodules/python2.6/gdata/auth.py", line 725, in perform_request
return http_client.request(operation, url, data=data, headers=headers)
File "/usr/lib/pymodules/python2.6/atom/http.py", line 169, in request
_send_data_part(data_part, connection)
File "/usr/lib/pymodules/python2.6/atom/http.py", line 358, in _send_data_part
connection.send(binarydata)
File "/usr/lib/python2.6/httplib.py", line 743, in send
self.sock.sendall(str)
File "/usr/lib/python2.6/ssl.py", line 203, in sendall
v = self.send(data[count:])
File "/usr/lib/python2.6/ssl.py", line 94, in
self.send = lambda data, flags=0: SSLSocket.send(self, data, flags)
File "/usr/lib/python2.6/ssl.py", line 174, in send
v = self._sslobj.write(data)
socket.error: [Errno 32] Broken pipe
For people who don't want videos uploaded, probably also preventing gh-8.
Traceback (most recent call last):
File "./gallery2picasa.py", line 107, in
main(sys.argv)
File "./gallery2picasa.py", line 101, in main
summary, filename, keywords=keywords)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 470, in InsertPhotoSimple
content_type)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 428, in InsertPhoto
raise GooglePhotosException(e.args[0])
gdata.photos.service.GooglePhotosException: (500, 'Internal Server Error', 'Error: 10 STORAGE_UNAVAIL')
Traceback (most recent call last):
File "./gallery2picasa.py", line 107, in
main(sys.argv)
File "./gallery2picasa.py", line 101, in main
summary, filename, keywords=keywords)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 470, in InsertPhotoSimple
content_type)
File "/usr/lib/pymodules/python2.6/gdata/photos/service.py", line 428, in InsertPhoto
raise GooglePhotosException(e.args[0])
gdata.photos.service.GooglePhotosException: (500, 'Internal Server Error', 'server is not responding')
I'm getting the following error immediately after saying "a" to upload all albums
:~/gtop/sebastianw-gallery2picasa-ef4259c# ./gallery2picasa.py -d naudtson -b root -t ng_ -u XXXX -g /homez.312/naudtson/g2data/
DB Password:
Google Password:
Upload Album "Gallery - 2004 - Corsica"? [y/N/a]a
CREATING ALBUM [Corsica] []
CREATING Item [F:IMG00001.JPG] [T:IMG00001.JPG] [S:IMG00001.JPG] [K:]
Traceback (most recent call last):
File "./gallery2picasa.py", line 275, in
main(sys.argv)
File "./gallery2picasa.py", line 262, in main
raise e
gdata.photos.service.GooglePhotosException: (601, "Found <type 'unicode'>, not path name or object with a .read() method", 'filename_or_handle
must be a path name or a file-like object')
[K:]
Traceback (most recent call last):
File "./gallery2picasa.py", line 153, in
main(sys.argv)
File "./gallery2picasa.py", line 134, in main
pws.InsertPhotoSimple(a.GetFeedLink().href, title,
NameError: global name 'a' is not defined
Hi,
I tried to utilize the script (which works great by the way) but encountered the following error while trying to authenticate:
Traceback (most recent call last):
File "./gallery2picasa.py", line 278, in
main(sys.argv)
File "./gallery2picasa.py", line 213, in main
galbum = create_google_album(pws, album, atitle, privacy)
File "./gallery2picasa.py", line 93, in create_google_album
raise e
gdata.photos.service.GooglePhotosException: (403, 'Forbidden', 'Modification only allowed with api authentication.')
Does that ring a bell?
Gallery version = 2.3 core 1.3.0
I've attempted the gallery2picasa script with gdata 2.0.17 and 2.0.14. Both end up with the same error...
gdata.photos.service.GooglePhotosException: (601, "Found , not path name or object with a .read() method", 'filename_or_handle must be a path name or a file-like object')
[~]# python2.6 public_html/cgi-bin/gallery2picasa-master/gallery2picasa.py -b XXXXXX -d XXXXXX -a XXXXXX -u XXXXXX -p XXXXXX
Upload Album ".com-gallery - 1975-1992"? [y/N/a]a
CREATING ALBUM [1975-1992] [Pix way back from 1975-1992]
CREATING Item [F:j_amp_g smithsonian trip.jpg] [T:j&g smithsonian trip] [S:Jeff Pinto and I posing next to me pop's plane at the Smithsonian.] [K:]
Traceback (most recent call last):
File "public_html/cgi-bin/gallery2picasa-master/gallery2picasa.py", line 275, in
main(sys.argv)
File "public_html/cgi-bin/gallery2picasa-master/gallery2picasa.py", line 262, in main
raise e
gdata.photos.service.GooglePhotosException: (601, u'Found /var/local/g2data/albums/1975-1992/j_amp_g smithsonian trip.jpg, not path name or object with a .read() method', 'filename_or_handle
must be a path name or a file-like object')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.