Very simple command line tool for automating photo archiving.
Having your images on your local computer grouped by date, this tool allows uploading files by mask
to Google Photos. A new album is created automatically. Name of the album is parsed from folder name that should match a date.
For instance:
- /photo/2020-01-02/
- /photo/2020_01_02/
- /photo/2020_01_02-vacation/jpeg
- /photo/2020_01_02 family/
- Checkout this repo:
git clone https://github.com/mbryzhko/photouploader.git
- Compile:
mvnw install -DskipTests
- Make a copy of configuration file:
/bin/pu.yaml.origin
->/bin/pu.yaml
- Specify credentials. See
How to retrieve Google Photos Access Key
. - Add absolute path of
/bin/pu[.cmd]
executable file intoPath
.
- Open Google OAuth Playground in a browser.
- Step #1. Specify scope:
https://www.googleapis.com/auth/photoslibrary, https://www.googleapis.com/auth/photoslibrary.sharing
and pressAuthorize APIs
. - On the next screen select your Google Photos Account.
- Step #2. Press button to exchange auth code for the Access Token.
- Copy value of the Access token.
- Navigate to a directory with images that should be uploaded.
- If files should be uploaded to already existing album then create a file
.uploader
and addgoogle_photo_album_id=<album reference>.
- Run CLI command:
pu upload
- Get Album by ID:
pu album -id=<album reference>
- Get Album by Name:
pu album -name=<album name>