Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid grant from Google Photos #56

Open
gdudek opened this issue Mar 30, 2020 · 27 comments
Open

invalid grant from Google Photos #56

gdudek opened this issue Mar 30, 2020 · 27 comments
Labels
help wanted Extra attention is needed

Comments

@gdudek
Copy link

gdudek commented Mar 30, 2020

On trying to use timeliner with Google Photos I am constantly getting a Bad Request error as follows:

 Get https://photoslibrary.googleapis.com/v1/albums?pageSize=50&pageToken=: oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Bad Request"
} <<< - retrying... (attempt 5/10)

Any ideas?

@mholt
Copy link
Owner

mholt commented Apr 6, 2020

I'm not sure, never seen that before!

Would be happy to have help if anyone could look into it.

@mholt mholt added the help wanted Extra attention is needed label Apr 6, 2020
@metahnetoutage
Copy link

I will take a look!

@metahnetoutage
Copy link

metahnetoutage commented Nov 17, 2021

Good News, I was able to provide access by merely added dimabeofek@gmail.com for OAuth consent screen Test users.
Granted access.

@metahnetoutage
Copy link

Studying how get-all works. Maybe it is related to this issue. This will fix sync issue.

@metahnetoutage
Copy link

FYI, if you check my fork, I added the ability to specify the path for the destination folder, so you are always in the know.

@metahnetoutage
Copy link

If something of mine is not running as the original this just means I got more work to do so that I behave better than original. Fingers crossed! Trying to make Timeliner beautiful!

@metahnetoutage
Copy link

metahnetoutage commented Nov 18, 2021

So, several things. Do not fork or pull my repo. Here is what I am up to:1) Fix sync issue on Silicon Mac if possible
2) Add custom repository setup, with a check if it exists.
3) Flatten data so that it is not in folders yet instead split purely by year folders.

@metahnetoutage
Copy link

metahnetoutage commented Nov 21, 2021

You will notice that I commented out get-latest...why? Because I am testing it. Do not fork yet. I am testing get-all yet must use faster network connection. I did enable Google Picker API as well as Google Photos library. I will see if the error is gone.
I also reset the secret after 2 days. Now I have timeliner2->timeliner which I will duplicate and make timeliner3(experimental) testing.

The code checking existence of file which I used can be found here: https://gist.github.com/mattes/d13e273314c3b3ade33f

@metahnetoutage
Copy link

On trying to use timeliner with Google Photos I am constantly getting a Bad Request error as follows:

 Get https://photoslibrary.googleapis.com/v1/albums?pageSize=50&pageToken=: oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Bad Request"
} <<< - retrying... (attempt 5/10)

Any ideas?

What command did you type? Can you please tell me, I do have a google project called Timeliner I made specifically to debug this app.
If you can provide the command you typed I can actually work on it. If I have just nailed getting all photos(I think I have) I can find a faster way to do so, in parallel hence timeliner3. Fix this bug(if it exists).

@mholt
Copy link
Owner

mholt commented Nov 22, 2021

Hey @metahnetoutage , sorry for the late reply. I see you've been quite active lately. Thanks for learning about this and trying various things, documenting your progress. I haven't had time to look into this recently but it's on my list. Good luck!

@metahnetoutage
Copy link

metahnetoutage commented Nov 22, 2021 via email

@mholt
Copy link
Owner

mholt commented Nov 22, 2021

I see those sometimes too, it's just the network (or their servers) being slow, that's why it retries.

@metahnetoutage
Copy link

metahnetoutage commented Nov 22, 2021 via email

@metahnetoutage
Copy link

metahnetoutage commented Nov 22, 2021 via email

@mholt
Copy link
Owner

mholt commented Nov 22, 2021

Can probably adjust timeouts in the dialer for the HTTP client. Look at the net/http and net packages for docs.

@metahnetoutage
Copy link

metahnetoutage commented Nov 22, 2021 via email

@metahnetoutage
Copy link

My first priority is fixing as many of 26 bugs as possible.

What are your thoughts about using mongoDB instead of sql3?
Also, I am considering integrating this for iCloud for timeliner, thoughts:
https://github.com/metahnetoutage/icloud

I forked it from another developer who forked it from author, yet developer did fixes author did not.
We should be able to use this, depends on their license of course.

@metahnetoutage
Copy link

I have turned timeliner2 into timeliner2 and did a copy. I will do a mongoDB example and show you. If you like it, we can proceed with it.

@metahnetoutage
Copy link

Interesting find, so I plugged 142.250.189.161 into Safari and I get Google.

What the error below means in my opinion is, we are very generous with retries, instead of being wise about it.
Meaning, Google say has the right to say, excuse me, my session for this moment is done.
timeliner:EHEM....GIVE ME THE VIDS AND PHOTOS....WAAAH! ;)

This is the logic I would follow, if we are approaching google timeout window, request a new time slice,
Get the length of data, and keep aggregating it, as we approach time limit, request a new time slice,
and continue this until data is fully transferred.

The same process should be for any data.

192.168.68.105:51880->142.250.189.161:443: read: operation timed
out

Thoughts?

@metahnetoutage
Copy link

Looking at NewRateLimitedRoundTripper from ratelimit.go, will test in timeliner3, if I nail it, I will apply to my repo!

@metahnetoutage
Copy link

metahnetoutage commented Jan 18, 2022 via email

@metahnetoutage
Copy link

metahnetoutage commented Jul 25, 2022 via email

@mholt
Copy link
Owner

mholt commented Jul 25, 2022

@metahnetoutage Thanks for the update. Sorry I haven't been very responsive.

The code for Google Photos authentication hasn't changed in Timelinize at this point (and yes, it is written in Go). So a contribution here can still be applied to the future result!

Can I send you an email about collaborating on it? What's your email address?

@metahnetoutage
Copy link

metahnetoutage commented Jul 25, 2022 via email

@mholt
Copy link
Owner

mholt commented Jul 25, 2022

@metahnetoutage Can you please comment on GitHub. When you reply from an email it redacts your address.

@metahnetoutage
Copy link

metahnetoutage commented Jul 25, 2022 via email

@metahnetoutage
Copy link

metahnetoutage commented Jul 25, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants