使用Youtube API v3从特定频道searchvideo
在我的项目中,我试图使用特定频道中的关键字进行search查询。 在Youtube API v3的文档中,他们说要search一个特定的频道,你需要把channelId放在查询中,但是这似乎不起作用。
现在,我正在使用“YouTube Direct Lite for iOS”库https://github.com/youtube/yt-direct-lite-iOS
有没有人知道什么是正确的方式来做一个search查询就像我想要这个库,甚至是URL来提出请求?
GTLQueryYouTube *queryUpload = [GTLQueryYouTube queryForSearchListWithPart:@"id,snippet"]; queryUpload.channelId = CHANNEL_ID; queryUpload.q = QUERY;
更新在Google Developer Youtube API v3的API资源pipe理器上testing的工作非常好:( https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list )
但是当我使用YouTube Direct Lite for iOS库时,即使设置了channelId,也会从其他频道返回video。
谢谢
你得到的错误是什么? 您的查询适合我。 更新:请再试一次,我相信之前有一个中断。
您可以进一步指定type = video来获取video作为回应。
对于代码示例,您可以检查: https : //github.com/youtube/yt-direct-lite-iOS