This is an unofficial Google Photos CLI which can be installed as a .NET Global Tool.
Google Photos CLI is an unofficial utility which leverages the CasCap.Apis.GooglePhotos library to perform common and helpful operations against the media items held in your Google Photos account.
If you find this tool of use then please give it a thumbs-up by giving this repository a โญ ... ๐
Key functionality;
- Media item upload
- Media item download/backup
- Media item duplicate detection
The Google Photos CLI is distributed as a .NET Core Global Tool, to install the tool follow these steps;
- Follow these instructions to set-up OAuth login details.
- Download and install either the .NET Core 3.1 SDK or .NET 6.0 SDK.
- From a command line shell install the tool
dotnet tool update --global googlephotos
Now check the tool is installed by entering googlephotos
at a shell.
Use the context-sensitive help command to discover additional functionality/arguments;
googlephotos --help
The tool will download and cache album and media item metadata locally for speed during duplicate detection. This local cache data is stored in your user profile. If you use the logout
command this local cache will be deleted;
googlephotos logout
Show context-senstive help for the albums sub-command;
googlephotos albums --help
List all albums;
googlephotos albums list
Show albums with duplicate names;
googlephotos albums list --duplicates
Add/create a new empty album with a title of 'my album title';
googlephotos albums add -t "my album title"
Download media items from specified album title into a folder;
googlephotos albums download -t "my album title" -o c:/temp/download
Download media items from specified album title into a folder, thumbnails, cropped, with EXIF information (except location);
googlephotos albums download -t "my album title" -o c:/temp/download --maxwidth 100
googlephotos albums download -t "my album title" -o c:/temp/download --maxheight 100
googlephotos albums download -t "my album title" -o c:/temp/download --maxheight 100 --crop
googlephotos albums download -t "my album title" -o c:/temp/download --maxheight 100 --crop --exif
googlephotos albums download -t "my album title" -o c:/temp/download --maxheight 100 --crop --exif --overwrite
Re-sync local album data with the latest data from the API;
googlephotos albums sync
Show context-senstive help for the media items sub-command;
googlephotos mediaitems --help
List all media items (this could be a very long list!);
googlephotos mediaitems list
Anaylse all meta data and search for possible duplicates;
googlephotos mediaitems duplicates
Upload media items into your google photos account, with optional pattern;
googlephotos mediaitems upload -s C:/temp/fotos
googlephotos mediaitems upload -s C:/temp/fotos --pattern *.jpg
This CLI is a work in progress, I have started lots of features or left stubs in the code which I hope to eventually complete... Please post any issues or feedback here.
GooglePhotosCli is Copyright ยฉ 2020 @f2calv under the MIT license.