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

Google OAuth2 changes of OOB causes drive API authorization failure, camera video upload to gdrive feature will not work #14

Open
denven opened this issue Nov 13, 2022 · 9 comments

Comments

@denven
Copy link
Collaborator

denven commented Nov 13, 2022

Error 400 invalid_request

Please check:

@denven denven changed the title Google OAuth2 changes of OOB cause drive API authorization failure, camera video upload to gdrive will not succeed Google OAuth2 changes of OOB causes drive API authorization failure, camera video upload to gdrive feature will not work Nov 13, 2022
@denven
Copy link
Collaborator Author

denven commented Nov 13, 2022

I've just fixed the above in a simple way, use the local loop ip address as the redirect uri, not very decent, but it works. I am thinking of other grant types of OAuth2 that can be used as well, but it needs more time to update the auth flow and verify it in the bash script.

@nelutzu777
Copy link

Please help with this hack, V4 https://github.com/avengermsoft/xiaomi_gdrive

@denven
Copy link
Collaborator Author

denven commented Apr 26, 2023

@nelutzu777 if you have tried this repo, please post your failure or error details here, since when I tried it last year, I fixed the authentication issue at that time.

@nelutzu777
Copy link

@nelutzu777 if you have tried this repo, please post your failure or error details here, since when I tried it last year, I fixed the authentication issue at that time.

/home/yi-hack-v5 # cd /tmp/sd/
/tmp/sd # sh yi-hack/gdrive/GDriveConf
Configuration is started. Wait for several seconds.
Enter your Client ID:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
Enter your Client secret:
xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxx-RX

Put this link into your browser:
https://accounts.google.com/o/oauth2/v2/auth?scope=https://www.googleapis.com/auth/drive&state=state&redirect_uri=http://127.0.0.1&response_type=code&client_id=00000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&access_type=offline

Copy and paste your code here:
4/0AVHEtk5X-eXXXXXXXXXXXHbsi1UGQdF5D1ZS2kXXXXXXXXXXXXXXXXXn4N6WxJPMT03eh7I7l-g
/tmp/sd/yi-hack/bin/./curl: line 1: syntax error: unexpected word (expecting ")")
grep: /tmp/sd/yi-hack/gdrive/conf/response: No such file or directory
grep: /tmp/sd/yi-hack/gdrive/conf/response: No such file or directory
Your code was expired or it is not correct. Please refresh a link in your browser and enter a new valid code:

@denven
Copy link
Collaborator Author

denven commented May 1, 2023

@nelutzu777

I downloaded the code and setup again, the repo code still works properly although I haven't used it for the past 5-6 months.
image

And I also reproduced your failure and error message below.

image

In one case, your failure is likely caused by the wrong client_id, client_secret, or generated authorization code copied during your setup, please make sure you copy the right client id and secret:
image

and copy the right authorization code from your browser URL as well. If you cannot easily find the right code to copy, you can refer to and use my repo code to do it more friendly.
image

In another case, if your issue persists, it may be caused by the version of your curl program or the running environment of gdrive uploader. You can try to type the below commands and paste your results here to check.

echo $PATH
echo $LD_LIBRARY_PATH
ls -lR /tmp/sd/yi-hack
curl --version
/tmp/sd/yi-hack/bin/curl --version
/tmp/sd/yi-hack/sbin/curl --version

@sebzgt2k
Copy link

sebzgt2k commented Feb 8, 2024

Hello

The real question I think :-) it's how it's possible to change the folder destination like in your example "YiHome1080p" ? Thanks a lot

@denven
Copy link
Collaborator Author

denven commented Feb 9, 2024

Hello

The real question I think :-) it's how it's possible to change the folder destination like in your example "YiHome1080p" ? Thanks a lot

I think you can create a folder with your desired name in your gdive before starting the setup. Your created folder will be listed as an option for you to choose as the upload destination, check step 5 in the below screenshot.

https://github.com/roleoroleo/yi-hack-MStar.gdrive/blob/master/screenshots/02.%20console%20configuration%20of%20google%20drive%20sync%20.png

@sebzgt2k
Copy link

sebzgt2k commented Feb 9, 2024

Thanks you so much I will check that

@mrxyzl
Copy link

mrxyzl commented Jun 16, 2024

Hello i also found that update the curl from the original project with the onedrive project also help with the error:
grep: /tmp/sd/yi-hack/gdrive/conf/response: No such file or directory
grep: /tmp/sd/yi-hack/gdrive/conf/response: No such file or directory
Your code was expired or it is not correct. Please refresh a link in your browser and enter a new valid code:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants