Go to file
Daniel Kluge 3cc11baafd „README.md“ ändern 2022-11-15 13:43:22 +01:00
src Add blog entry 2022-08-08 12:25:13 +02:00
.gitignore Sync script 2022-05-07 22:14:31 +02:00
LICENSE Add license 2022-05-07 22:26:09 +02:00
README.md „README.md“ ändern 2022-11-15 13:43:22 +01:00
package-lock.json Initial commit 2022-05-07 22:14:31 +02:00
package.json Add keyword 2022-05-07 22:14:31 +02:00
secrets.template.json Add empty secrets.json 2022-05-07 22:24:44 +02:00

README.md

Google Photo Album Sync

Read the blog entry at c0ntroller.de

A script that will download all images from an album. Perfect to use if you have a local directory for your background, chromecast or whatever.

Setup

  1. Create a Google Project
    • You will need the client id and client secret and put it in the secrets.json
  2. Run npm run token
    • A browser tab should open where you log in with your Google Account and allow access to your app.
    • If something fails, press Ctrl + C in the terminal and try again.
  3. Run npm run albums and pick an album you want to sync. This will not start the download.
  4. You are all set up!

Running it

$ npm run sync -- [output_directory] [options...]

This will download the album to your drive. By default a directory named album is created where the images are stored. If this is sufficient you can omit this and still use the options below.

Other options are available as well:

Option Effect
--force Redownload all images no matter if they already exist on the system. By default they are skipped.
--cleanup Delete images not found in the album anymore.
--quiet No useless logs.
--raw Download RAW images.

Using it

Run it manually or add a cronjob with the following configuration:

# crontab -u username -e
# Add this line
*/15 * * * * node /path/to/src/sync.js /path/to/output --quiet --cleanup

Of course any options can be used.