Using Google photos API (Picasa API) to upload pictures from desktop to Google photos. Script can do the following:
- Show all existing albums
- Dry Run mode - will show what the script will do, but won't upload pics
- Uploads all images
- Download library
gdata-python-client
- Add
PYTHONPATH
with path where the library is extracted Steps here - Create keys in google cloud project and get ID and Secret Key Steps here
- Install all dependencies. All packages on my system are in
packages.txt
- Create a new album for uploading photos on Google Photos.
- Open
UploadPhotos.py
and change config variables (SetMODE=1
initially) - Run the script and install all missing dependencies/resolve python errors. You should see list of all you albums including the one you created.
- Copy the id of that album (numeric number) and add it to config.
- Run the script with
MODE=2
. You should see all messages of what the script will do. - If everything looks good, then run with
MODE=3
. You should see all photos that have been uploaded.
- if
client_secrets.json
andcredentials.dat
are not created automatically, then create blank files manually. result.log
file contains all log messages that are also displayed on the console.error.log
file contains path of all images that may not have been uploadedother_files.log
contains path of all files that were not image files found in the folders.- Script adds all pictures recursively while doing the following:
- Say your picture is in
rootdir/Trip1/Beach/pic1.jpg
. Then the file name would bepic1.jpg
and summary of pic would beTrip1, Beach
- If the folder (not root folder) has date (e.g.
2017-02-28 - Beach day
), then you can setUPDATE_FILE_METADATA
in config toTrue
. This will check all pics in that folder and update metadata date to2017-02-28
if date on picture and folder differs by more thanFILE_METADATA_DATE_TOLERANCE
(in config)
- Say your picture is in