Sync contact images from Google to vcards (Nextcloud, ownCloud)
Перейти к файлу
IamTheFij 44a245bc9d Add a bit more debugging and pin python version to 3.7 since there are issues with 3.9 2021-03-08 15:36:02 -05:00
google_photo_to_vcard Add a bit more debugging and pin python version to 3.7 since there are issues with 3.9 2021-03-08 15:36:02 -05:00
.gitignore Now with working everything 2018-04-04 16:55:09 -07:00
Makefile Add a bit more debugging and pin python version to 3.7 since there are issues with 3.9 2021-03-08 15:36:02 -05:00
Readme.md Add Gravatar fallback and improve logging 2018-04-05 15:30:18 -07:00
khard-wrapper Now with working everything 2018-04-04 16:55:09 -07:00
khard.conf Now with working everything 2018-04-04 16:55:09 -07:00
requirements.txt Add a bit more debugging and pin python version to 3.7 since there are issues with 3.9 2021-03-08 15:36:02 -05:00
vdirsyncer-wrapper Add a bit more debugging and pin python version to 3.7 since there are issues with 3.9 2021-03-08 15:36:02 -05:00
vdirsyncer.conf.example Clean config template and provide readme 2018-04-04 18:19:41 -07:00

Readme.md

Google Photo to VCard

A set of scripts to download profile images from Google and write them to vcards. Useful for completing the migration from Google to Nextcloud or ownCloud.

As a fallback, if a user doesn't have a Google profile photo, the script will check Gravatar.

Setup

To run, you first need to set up a few config files

Google Credentials

To get people info from your Google account, you first need to create an application from the Google Cloud Console and then download your credentials.

  1. Go to https://console.developers.google.com and create a new project
  2. Add access to the Google People API (Library > Search for People > Enable)
  3. Create a new set of credentials (Credentials > Create credentials > OAuth client ID > other (Give it a name) > Create)
  4. Click the download icon next to the new credentials and save to this project directory as client_secret.json

Vdirsyncer Config

This is the config that will allow you to sync to and from your remote VCard directory. The following instructions are for Nextcloud, but you can refer to the official documentation for more instructions.

Edit ./vdirsyncer.conf.example adding your server url, username, and password in the [storage my_contacts_remote] section.

Running

Once your configuration is set up, you should be able to download and add photos to all your contacts by executing:

make add-photos

It's then worth taking a look and making sure that the results are as you expected. When you're happy with them, you can push the contacts back up to your remote server by running:

make sync-contacts