Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Oauth2.json not generated after calling flow_from_clientsecrets with my client secrets file

$
0
0

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 directory

warnings.warn(_MISSING_FILE_MESSAGE.format(filename))


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>