我有一台机器进行测试,Fowlloing代码会很好,但是当我部署到生产服务器时,它将显示超时。
错误:
socket.timeout : timeout
此服务器具有防火墙,但已经允许使用google ip。这个插座会像握把一样吗,还是Google需要将其连接到我的服务器的标准配置?
代码:
from google.oauth2 import service_account
import googleapiclient.discovery
SCOPES = ['https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.readonly']
SERVICE_ACCOUNT_FILE = 'client_secret.json'
API_SERVICE_NAME = 'drive'
API_VERSION = 'v3'
credentials = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE, scopes=SCOPES)
service = googleapiclient.discovery.build(API_SERVICE_NAME, API_VERSION, credentials=credentials)