/GPUcli

Google Photos Upload CLI

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

GPUcli.py is a command line tool written in python which allows you to upload media to your Google Photos account.

At this moment the tool will NOT walk through directory trees. It will upload media from a given directory. It's possible to use the ALBUM switch, which will make this tool create an album named by the source folder name. The uploaded media will be added to this album.

Table of Contents

Important notice to remember

All media items uploaded to Google Photos through the API are stored in full resolution at original quality. These uploads will count towards storage of the linked Google Account.

Donation

Since I'm developing in my free time I'd like to ask you to support my work. This will give me motivation to keep on coding and fixing bugs.

Thanks in advance

DONATE NOW VIA PAYPAL

Known issues

Requirements

There are some requirements which have to be fulfilled to make this tool work.

  • You have to enable Google Photos API within the google cloud console (https://console.cloud.google.com/apis)
  • You have to create an OAuth-Client-ID within this console.
  • Configure the generated client_id and client_secret on the first lines of this tool.
 # Define client_id und client_secret created by the google api console.
 client_id = ''
 client_secret = ''

Authorize access

Running this tool the first time will trigger a access_token generation process. You will need to allow this tool to access your Google Photos library.

  • You will have to copy an URL and paste it into your browser. A google website will appear where you will have to confirm the needed permissions.
  • Afterwards google will redirect you to an invalid localhost URL. You have to copy this URL from your browser into your terminal client when the GPUcli.py asks you for that.
  • Finally the tool will save an token.dat to your local filesystem where your access token will be stored.

Usage

You can see all the mighty arguments by showing the help:

 ./GPUcli.py -h

Greets and have fun with this little goodie... Sascha Schmidt