无法获取示例GoogleAppyOnClient/samples/urlshortener/

2024-04-27 06:49:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试编写一个python脚本,在我的goo.gl公司短网址。我想我可以试着先让这个样本工作:

https://github.com/google/google-api-python-client/tree/master/samples/urlshortener

我的client_secrets.json是这样填写的(实际上客户端id和客户端secret是模糊的):

{
  "other": {
    "client_id": "[['mYcLIent_1dapps.googleusercontent.com']]",
    "client_secret": "[['mYCLient_53cr3t']]",
    "redirect_uris": [],
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token"
  }
}

但当我执行脚本时,我得到了:

$ ./urlshortener.py --logging_level=DEBUG
WARNING: Please configure OAuth 2.0

To make this sample run you will need to populate the client_secrets.json file
found at:

   ./client_secrets.json

with information from the APIs Console <https://code.google.com/apis/console>.

Tags: https脚本comclientauthidjson客户端