YouTube API v3 apiclient.errors.HttpError quot;No filter selected.quot; - where do I select a filter?(YouTube API v3 apiclient.errors.HttpError“未选择过滤器.- 我在哪里选择过滤器?)
问题描述
我第一次尝试为 YouTube 设置 Google apiclient
,并按照我所做的文档作为测试(没有找到 YouTube API 的具体示例):
My first attempt at setting up the Google apiclient
for YouTube and by following the docs I made this as a test (didn't find a specific example for the 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
来获取视频详细信息.
Obviously I'm missing this filter
, but I can't seem to find it anywhere in the docs google-api-client-libraries.appspot.com. My intent is to fetch a videos details by providing its id
.
推荐答案
您至少需要一个选择器才能列出.id"就是其中之一.您可以随时查看 YouTube API 示例 项目以供参考.这是 Python 列表用法在一个例子中.
You need at least one selector to list. 'id' is one of them. You can always check YouTube API Samples project for reference. Here's a Python list usage in one of examples.
这篇关于YouTube API v3 apiclient.errors.HttpError“未选择过滤器."- 我在哪里选择过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:YouTube API v3 apiclient.errors.HttpError“未选择过滤器."- 我在哪里选择过滤器?
- YouTube API v3 返回截断的观看记录 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01