YouTube API v3 apiclient.errors.HttpError“未选择过滤器."- 我在哪里选择过滤器?

YouTube API v3 apiclient.errors.HttpError quot;No filter selected.quot; - where do I select a filter?(YouTube API v3 apiclient.errors.HttpError“未选择过滤器.- 我在哪里选择过滤器?)
本文介绍了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“未选择过滤器."- 我在哪里选择过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Leetcode 234: Palindrome LinkedList(Leetcode 234:回文链接列表)
How do I read an Excel file directly from Dropbox#39;s API using pandas.read_excel()?(如何使用PANDAS.READ_EXCEL()直接从Dropbox的API读取Excel文件?)
subprocess.Popen tries to write to nonexistent pipe(子进程。打开尝试写入不存在的管道)
I want to realize Popen-code from Windows to Linux:(我想实现从Windows到Linux的POpen-code:)
Reading stdout from a subprocess in real time(实时读取子进程中的标准输出)
How to call type safely on a random file in Python?(如何在Python中安全地调用随机文件上的类型?)