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.
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.
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
- An internal API limit is reached very fast. Seems to be a bug. Issue opened, but not solved until now (https://issuetracker.google.com/issues/115932469)
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 = ''
- Remove any existing client permissions on first start: https://myaccount.google.com/u/0/permissions.
- Install oauthlib and requests_oauthlib python libraries within the folder of this tool.
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.
You can see all the mighty arguments by showing the help:
./GPUcli.py -h
Greets and have fun with this little goodie... Sascha Schmidt