出于某种原因,我无法通过 API 获取某些 channel 的任何信息。例如这个 channel :http://youtube.com/vithorvascovv和 API 请求GET https://www.googleapis.com/youtube/v3/channels?part=id&forUsername=vithorvascovv&key={YOUR_API_KEY}
给我空洞的回应。为什么?您可以try here与 part=id
和 forUsername=vithorvascovv
.
即使我使用这样的搜索方法:GET https://www.googleapis.com/youtube/v3/search?part=id&q=vithorvascovv&type=channel&key={YOUR_API_KEY}
我有空响应,但在同一时间可以使用常规 search on Youtube 找到 channel .
另一个有同样问题的 channel 名称:Nsamurail
最佳答案
看起来用户“vithorvascovv”与另一个 channel 合并了。我不确定为什么用户名查找不再起作用,但我看到 http://youtube.com/vithorvascovv重定向到 https://www.youtube.com/channel/UCsLprVocGZ9mUl6SGBZ91Ng .使用 part=id
和 id=UCsLprVocGZ9mUl6SGBZ91Ng
,我能够从 API 返回正确的结果。
对于您的第二个问题,用户“Nsamurail”似乎将他们的用户名更改为“xRidan”(http://www.youtube.com/Nsamurail 重定向到 https://www.youtube.com/user/xRidan)。使用 part=id
和 forUsername=xRidan
,我能够从 API 返回 channel 信息。
关于YouTube API v3 channel : list method doesn't work for some channels names,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35051882/