gilesknap / gphotos-sync

Google Photos and Albums backup with Google Photos Library API
Apache License 2.0
1.97k stars 161 forks source link

How to generate Oauth client id for kids under 13 of age in google families #433

Closed cosote closed 1 year ago

cosote commented 1 year ago

Hi,

I try to keep an eye on my kids videos and photos, so I like to sync the entire google photos files to my server for general review purposes. But with my kids google account, I cannot access the google api console to generate an oauth client id. Any idea how to do it - or should I simply make my kids older for google?

Cheers - cosote.

gilesknap commented 1 year ago

@cosote you might have some luck with the library sharing feature of google photos - I can't remember if libraries shared in this way show up in your Google Photos API index or not.

https://support.google.com/photos/answer/7378858?hl=en-GB&co=GENIE.Platform%3DDesktop

Otherwise I guess you need to make your children older like you suggest!

cosote commented 1 year ago

@gilesknap Thx for the tip. I've check, but partner sharing is also not available for kids. I've now changed my kids age and check in a couple days again if I can access the console then.

Now I just remembered that the backup project I use for my home assistant is using a nice alternative to generating client id and secret via use of https://habackup.io - I found more details of the HA extension here: https://github.com/sabeechen/hassio-google-drive-backup/blob/master/hassio-google-drive-backup/AUTHENTICATION.md But it would require a tiny service running on a domain like gphotos-sync.io or so and a way to initiate that one time token generation somehow... BTW: MultCloud services actually does work with Google Photos for my kids.

gilesknap commented 1 year ago

@cosote thanks for the tip re habackup.io. I have to confess at first reading I don't exactly get it, but will look into it more.

cosote commented 1 year ago

haha - I did a simple mistake: I was trying to create the client_secret.json for my kids accounts. I simply used mine and auth'd the kids accounts against my app... all is working now like a charm after adding them also as Test user on the welcome screen. BTW: you could open automatically the browser with the one time URL, or?

gilesknap commented 1 year ago

@cosote my apologies. Now that you say this I realize that is the obvious answer.

The only reason to have a token is to have permission to run the app with access to Google Photos API, you can authenticate any user using that app token and hand over permission to access their library.

Therefore as soon as you have a .gphotos.token file you can re-use it for as many libraries as you like.

Google also keeps a quota for the number of calls to the API your instance of the app can use per day for free. So if your kids have a very large number of photos and you have a very fast connection you might hit that quota (in which case you would just need to wait for a while and run again).

(if it wasn't for the quota I could just publish a token for everyone to use for ghotos-sync and avoid the complexity of everyone generating their own)