我曾尝试添加自定义return_uri
,但现在允许添加。
它默认分配自己的本地主机 URL。
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
'client_secrets.json', SCOPES)
creds = flow.run_local_server()
# Save the credentials for the next run
with open('token.json', 'w') as token:
token.write(creds.to_json())
请任何人都可以帮助我