gpt4 book ai didi

youtube - 通过 channel 名称而不是用户名搜索 youTube V3 API?

转载 作者:行者123 更新时间:2023-12-03 05:21:12 25 4
gpt4 key购买 nike

Youtube 允许用户名和 channel 名称。它们可以彼此不同。 youtube API 允许我通过用户名进行搜索,但我看不到在哪里或如何通过 channel 名称进行搜索。它是显示在视频下方的 channel 名称。 有人阐明了如何通过 channel 名称/标题和不是 用户名进行搜索吗?谢谢

最佳答案

如果 channel 搜索 API 没有返回结果我调用搜索 API

https://www.googleapis.com/youtube/v3/search?part=snippet&type=channel&maxResults=1&q=( <#潜​​在 channel 名称#>)

因此它运行标准搜索以输入值“潜在 channel 名称”。 Google 文档说第一个返回的结果将是一个 channel ,所以我们只需要 1 个结果,这就是我们设置 maxResults=1 的原因。

如果没有返回任何内容,那么我假设 channel 不存在并向用户显示错误

关于youtube - 通过 channel 名称而不是用户名搜索 youTube V3 API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32095099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com