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“未选择过滤器."- 我在哪里选择过滤器?


基础教程推荐
- 求两个直方图的卷积 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 包装空间模型 2022-01-01