Code Monkey home page Code Monkey logo

cascap.googlephotoscli's Introduction

Google Photos CLI (a work in progress)

Unofficial Google Photos Command Line Interface

CI Coverage Status SonarCloud Coverage Nuget

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

Installation/Set-up

The Google Photos CLI is distributed as a .NET Core Global Tool, to install the tool follow these steps;

Now check the tool is installed by entering googlephotos at a shell.

Usage

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

Albums

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

MediaItems

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

Feedback/Issues

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.

License

GooglePhotosCli is Copyright ยฉ 2020 @f2calv under the MIT license.

cascap.googlephotoscli's People

Contributors

dcuccia avatar dependabot-preview[bot] avatar f2calv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cascap.googlephotoscli's Issues

googlephotos albums list causes System.NullReferenceException

FWIW, from Powershell in Windows Terminal on Windows 11 Pro x64 running the latest CLI preview 0.1.15, I get the following response to googlephotos albums list:

PS C:\Users\USER> googlephotos albums list
creating user folder C:\Users\USER\AppData\Roaming\googlephotos\[email protected]
Page 1 14 +14
Page 2 29 +15
Page 3 44 +15
Page 4 49 +5
Page 5 66 +17
Page 6 68 +2
Page 7 73 +5
Page 8 75 +2
Page 9 75 +0
Page 10 78 +3
Page 11 81 +3
Page 12 82 +1
Page 13 84 +2
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at BetterConsoleTables.Table.GetColumnLengths()
at CasCap.Commands.CommandBase.DisplayAlbums(List1 albums) in /_/src/CasCap.GooglePhotosCli/Commands/Base/CommandBase.cs:line 150 at CasCap.Commands.Albums.List.OnExecuteAsync(CommandLineApplication app) in /_/src/CasCap.GooglePhotosCli/Commands/Albums.cs:line 60 at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments) at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken) at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext() --- End of stack trace from previous location --- at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken) at McMaster.Extensions.Hosting.CommandLine.Internal.CommandLineService1.RunAsync(CancellationToken cancellationToken)
at McMaster.Extensions.Hosting.CommandLine.Internal.CommandLineLifetime.<>c__DisplayClass10_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.Extensions.Hosting.HostExtensions.RunCommandLineApplicationAsync(IHost host, CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostBuilderExtensions.RunCommandLineApplicationAsync[TApp](IHostBuilder hostBuilder, String[] args, Action`1 configure, CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostBuilderExtensions.RunCommandLineApplicationAsync[TApp](IHostBuilder hostBuilder, String[] args, CancellationToken cancellationToken)
at CasCap.Program.Main(String[] args) in /_/src/CasCap.GooglePhotosCli/Program.cs:line 39
at CasCap.Program.

(String[] args)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.