我第一次尝试为 YouTube 设置 Google apiclient
,并按照我做的文档作为测试(没有找到 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
.