无法获得样本google-api-python-client / samples / urlshortener /工作

时间:2016-05-01 05:42:11

标签: python google-oauth2 google-url-shortener

我正在尝试编写一个python脚本,该脚本将点击我的goo.gl缩短的URL。我想我可以尝试让这个样本先工作:

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

我这样填写client_secrets.json(实际上client_id和client_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>.

0 个答案:

没有答案