Trying to run the code below and keep getting told that there's no such file or directory as main.py-oauth2.json. Anyone got any idea what could be going wrong? Printing storage shows it is an oauth2client.file.Storage object. Is this an issue with using the flow_from_clientsecrets method or an issue with creating the Storage class instance?
Code:
def get_authenticated_service():flow = flow_from_clientsecrets(CLIENT_SECRETS_FILE, scope=YOUTUBE_SCOPE,message=MISSING_CLIENT_SECRETS_MESSAGE)storage = Storage("%s-oauth2.json" % sys.argv[0])credentials = storage.get()if credentials is None or credentials.invalid: credentials = tools.run_flow(flow, storage)return build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, http=credentials.authorize(httplib2.Http()))Error message:
/home/runner/project/venv/lib/python3.8/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access main.py-oauth2.json: No such file or directorywarnings.warn(_MISSING_FILE_MESSAGE.format(filename))