A Google Photos backup tool.
gitmoo-goog tool uses Google Photos API to continously download all photos on a local device.
It can be used as a daemon to keep in sync with a google-photos account.
Download:
Unzip and run, there are no other dependencies.
(There is more than one way to do the following):
- Go to API
- Click on
Enable the Google Photos APIbutton - Create a new project, name it whatever you like.
- Write
gitmoo-googin theproduct namefield, (can be whatever you like) - On the
when are you calling from, chooseOther, clickCreate. - Download the client configuration.
- Copy the downloaded
credentials.jsonto the same folder withgitmoo-goog. - run
gitmoo-goog, and follow the provided link: - Sign in, and click
Allow - Copy the
tokenand paste it in the cli. gitmoo-googwill authorize and start downloading content.
$ ./gitmoo-goog
2018/09/12 10:18:07 This is gitmoo-goog ver 0.1
Go to the following link in your browser then type the authorization code:
https://accounts.google.com/o/oauth2/auth?access_type=...
4/WACqgFeX5OTB8X4LWd5i2TFH....
Saving credential file to: token.json
2018/09/12 10:20:07 Connecting ...
2018/09/12 10:20:07 Processed: 0, Downloaded: 0, Errors: 0, Total Size: 0 B, Waiting 5s
This is probably not what you want, hit crt-c to stop it.
Usage of ./gitmoo-goog:
-album string
use albumID to limit download to specific album (https://developers.google.com/photos/library/guides/list#listing-albums)
-folder string
backup folder
-force
ignore errors, and force working
-logfile string
log to this file
-loop
loops forever (use as daemon)
-max int
max items to download (default 2147483647)
-throttle int
Time, in seconds, to wait between API calls (default 5)
On Linux, running the following is a good practice:
$ ./gitmoo-goog -folder archive -logfile gitmoo.log -loop -throttle 45 &
This will start the process in background, making an API call every 45 seconds, looping forever on all items and saving them to {pwd}/archive.
Logfile will be saved as gitmoo.log.
Files are created as follows:
[folder][year][month][day]_[hash].json and .jpg. The json file holds the metadata from google-photos.