我第一次尝试apiclient
为YouTube 设置Google ,并按照文档进行了测试(没有找到YouTube API的特定示例):
import json from apiclient.discovery import build service = build('youtube', 'v3', developerKey = 'tralalala') videos = service.videos() request = videos.list(part = '7lCDEYXw3mM') # some video id response = request.execute() json.dumps(response, sort_keys = True, indent = 4)
我明白了
{ "error": { "errors": [ { "domain": "youtube.parameter", "reason": "missingRequiredParameter", "message": "No filter selected.", "locationType": "parameter", "location": "" } ], "code": 400, "message": "No filter selected." } }
显然,我缺少此功能filter
,但是我似乎无法在google-api-client-libraries.appspot.com文档中的任何位置找到它。我的意图是通过提供视频来获取视频详细信息id
。