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

Error when uploading to Google Drive with new token #76

Closed
jeremymeyers opened this issue Sep 3, 2020 · 4 comments
Closed

Error when uploading to Google Drive with new token #76

jeremymeyers opened this issue Sep 3, 2020 · 4 comments
Labels
question Further information is requested
Milestone

Comments

@jeremymeyers
Copy link

trying to run after setting up API credentials as listed in the docs, gt the following log:

$ pipenv run python ./src/fb2cal.py
[2020-09-03 13:53:49,244] fb2cal INFO () Starting fb2cal v1.1.0 (Production) [https://git.io/fjMwr]
[2020-09-03 13:53:49,245] fb2cal INFO () This project is released under the GPLv3 license.
[2020-09-03 13:53:49,245] fb2cal INFO (main) Attemping to parse config file config.ini...
[2020-09-03 13:53:49,246] fb2cal INFO (main) Config successfully loaded.
[2020-09-03 13:53:49,246] fb2cal INFO (main) Logging level set to: DEBUG
[2020-09-03 13:53:49,246] fb2cal INFO (main) Authenticating with Google Drive API...
/Users/XXX/.local/share/virtualenvs/fb2cal-master-xuy03aqp/lib/python3.8/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access token.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
File "./src/fb2cal.py", line 744, in
main()
File "./src/fb2cal.py", line 104, in main
service = google_drive_api_authenticate()
File "./src/fb2cal.py", line 277, in google_drive_api_authenticate
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)
File "/Users/XXX/.local/share/virtualenvs/fb2cal-master-xuy03aqp/lib/python3.8/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Users/XXX/.local/share/virtualenvs/fb2cal-master-xuy03aqp/lib/python3.8/site-packages/oauth2client/client.py", line 2134, in flow_from_clientsecrets
client_type, client_info = clientsecrets.loadfile(filename,
File "/Users/XXX/.local/share/virtualenvs/fb2cal-master-xuy03aqp/lib/python3.8/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile
return _loadfile(filename)
File "/Users/XXX/.local/share/virtualenvs/fb2cal-master-xuy03aqp/lib/python3.8/site-packages/oauth2client/clientsecrets.py", line 126, in _loadfile
return _validate_clientsecrets(obj)
File "/Users/XXX/.local/share/virtualenvs/fb2cal-master-xuy03aqp/lib/python3.8/site-packages/oauth2client/clientsecrets.py", line 99, in _validate_clientsecrets
raise InvalidClientSecretsError(
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "redirect_uris" in a client type of "web".

A few other notes:

  • Docs say to rename the token downloaded from google API as credentials.json, not token.json (dunno if this is relevant)
  • Docs do not suggest creating a redirect URI is necessary (this is my first time setting upa google OAuth, tho not my first time working with that sort of thing)
  • It works fine when saving file locally

Here's what's in the log file, probably less than helpful
[2020-09-03 13:53:49,244] fb2cal INFO () Starting fb2cal v1.1.0 (Production) [https://git.io/fjMwr]
[2020-09-03 13:53:49,245] fb2cal INFO () This project is released under the GPLv3 license.
[2020-09-03 13:53:49,245] fb2cal INFO (main) Attemping to parse config file config.ini...
[2020-09-03 13:53:49,246] fb2cal INFO (main) Config successfully loaded.
[2020-09-03 13:53:49,246] fb2cal INFO (main) Logging level set to: DEBUG
[2020-09-03 13:53:49,246] fb2cal INFO (main) Authenticating with Google Drive API...

@jeremymeyers
Copy link
Author

Also docs say to set 'other' as application type but that doesn't seem to be an option on google anymore
Screen Shot 2020-09-03 at 1 44 10 PM

@mobeigi mobeigi added the question Further information is requested label Sep 3, 2020
@mobeigi
Copy link
Owner

mobeigi commented Sep 3, 2020

Hi @jeremymeyers , it looks the Google API has changed slightly so we may need to revise those steps.

Also the automated Google API approach seems to be unpopular as it does break quite a bit too. I am considering removing it completely and just having this tool provide an ICS file which you can then do whatever you want with.

@jeremymeyers
Copy link
Author

I mean it's easy enough on Mac to move the ics file over to google drive. Maybe if you added an "output directory" variable in the config that people could set to their cloud storage (or if you wanted to be more end-user friendly you could provide defaults for gdrive/dropbox maybe) and then it would output the DRIVE_FILE_ID to stdout to be copy/pasted?

@mobeigi
Copy link
Owner

mobeigi commented Sep 4, 2020

@jeremymeyers Saving to your cloud storage folder locally should already be possible using:
FILESYSTEM.save_to_file and FILESYSTEM.ics_file_path in the config.

Overall I feel like the Drive integration is just trying to mimic the old behaviour and its not really what this script should be doing. I think imma strip it out completely.

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

No branches or pull requests

2 participants