pibooth-google-photo

Pibooth plugin to upload pictures on Google Photos.


Keywords
Raspberry, Pi, camera, photobooth, google-photos, photo-booth, plugin, raspberry-pi, raspberrypi
License
GPL-3.0
Install
pip install pibooth-google-photo==1.2.3

Documentation

pibooth-google-photo

Python 3.6+ PyPi package PyPi downloads

pibooth-google-photo is a plugin for the pibooth application.

Its permits to upload the pictures to a Google Photos album. It requires an internet connection.

Install

$ pip3 install pibooth-google-photo

Configuration

Here below the new configuration options available in the pibooth configuration. The keys and their default values are automatically added to your configuration after first pibooth restart.

[GOOGLE]

# Album where pictures are uploaded
album_name = Pibooth

# Credentials file downloaded from Google API
client_id_file =

Note

Edit the configuration by running the command pibooth --config.

Picture URL

Uploaded picture URL is set to app.previous_picture_url attribute at the end of processing state (state_processing_exit hook).

Warning

for security reason, URL will expire in 1 hour.

Grant secured access

Access to a Google Photos album is granted by a Credentials file that shall be defined in the [GOOGLE][client_id_file] configuration key. This file does not contain your Google credentials and it can not be used by an other application than pibooth.

It contains the Google Photos API key (Client ID and Client Secret) generated by following the instructions:

step1_shortcut_button Go to Google Photos Library API and click on Enable the Google Photos Library API.
step2_project_name Enter a project name (for instance pibooth) and click on NEXT.
step3_display_name Enter a text to be displayed on user consent page when you will start pibooth with pibooth-google-photo enabled for the first time (for instance Pibooth) and click on NEXT.
step4_app_type Select the application type: Desktop app.and click on CREATE.
step5_download Download the credential file, save it somewhere accessible by pibooth and click on DONE.

The content of the Credentials file looks like this:

{
    "installed":
        {
        "client_id": "8723982792-sdjfhdkjhvfkd76.apps.googleusercontent.com",
        "client_secret": "HJAHZhjhi_HJI789798giEdPIbJ",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://www.googleapis.com/oauth2/v3/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob","http://localhost"]
        }
}

Note

At the first connection, allow pibooth to use Google Photos in the opened web browser window.