python备份文件到谷歌Drive
原文 https://developers.google.com/drive/v3/web/quickstart/python
安装依赖
pip install --upgrade google-api-python-client
下载认证文件 client_secret.json
谷歌上的步骤:
1 | Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials. |
内容大概如下
1 | {"installed":{"client_id":"334720361216-xxxxx.apps.googleusercontent.com","project_id":"analog-fastness-167807","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"xxxxxx","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}} |
代码
1 | #!/usr/bin/env python |