hrishikeshrt / google_drive_ocr

Perform OCR using Google's Drive API v3
Other
37 stars 10 forks source link

Is application working atm? #6

Closed Goofych closed 1 year ago

Goofych commented 1 year ago

Question:

Can you confirm what this application still working as intended? I first set it up about a month ago and successfully used for a while. Today I attempted to OCR some images, but now then I try to use it in command line mode I am getting this Here is the error block:

Traceback (most recent call last): File "C:\Utils\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Utils\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Utils\Python\Python310\Scripts\google-ocr.exe__main.py", line 7, in File "C:\Utils\Python\Python310\lib\site-packages\google_drive_ocr\cli.py", line 117, in main app = GoogleOCRApplication( File "", line 9, in init File "C:\Utils\Python\Python310\lib\site-packages\google_drive_ocr\application.py", line 98, in post_init__ creds = self.get_credentials() File "C:\Utils\Python\Python310\lib\site-packages\google_drive_ocr\application.py", line 144, in get_credentials creds.refresh(Request()) File "C:\Utils\Python\Python310\lib\site-packages\google\oauth2\credentials.py", line 339, in refresh ) = reauth.refresh_grant( File "C:\Utils\Python\Python310\lib\site-packages\google\oauth2\reauth.py", line 367, in refresh_grant _client._handle_error_response(response_data, retryable_error) File "C:\Utils\Python\Python310\lib\site-packages\google\oauth2_client.py", line 74, in _handle_error_response raise exceptions.RefreshError( google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant', 'error_description': 'Bad Request'})

I tried creating and using new secret.json but nothing changes. Did I managed to mess something up on my side between then and now, or is this just google changing stuff over time?

Goofych commented 1 year ago

UPD I tracked down token location and deleted it. It helped, new token.json had been created and program now working as expected..

hrishikeshrt commented 1 year ago

Invalid grant refers indeed to the credential file.

Reference: https://github.com/googleapis/python-storage/issues/341

Glad you got it working.