我正在尝试在youtube数据api上搜索“联合”属性设置为“允许”的视频(因此应该允许它们在移动设备上播放)。
我试过这样:
https://gdata.youtube.com/feeds/api/videos?q=music&v=2&prettyprint=true&fields=entry[yt:accessControl/@action='syndicate'](id,title,yt:accessControl)
返回Feed如下所示:
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:yt='http://gdata.youtube.com/schemas/2007'>
<entry>
<id>tag:youtube.com,2008:video:XXXXXXX</id>
<title>XXXXXXX</title>
<yt:accessControl action='comment' permission='allowed'/>
<yt:accessControl action='commentVote' permission='allowed'/>
<yt:accessControl action='videoRespond' permission='moderated'/>
<yt:accessControl action='rate' permission='allowed'/>
<yt:accessControl action='embed' permission='allowed'/>
<yt:accessControl action='list' permission='allowed'/>
<yt:accessControl action='autoPlay' permission='allowed'/>
<yt:accessControl action='syndicate' permission='denied'/>
</entry>
这很好,但是现在我还需要整合“permission ='allowed'”条件。我已经尝试了很多不同的组合(参见https://developers.google.com/youtube/2.0/developers_guide_protocol_partial?hl=de#Fields_Formatting_Rules),但无法使其正常工作。任何提示?
答案 0 :(得分:1)
为什么不使用V3 API?这是您的查询: https://www.googleapis.com/youtube/v3/search?part=id%2C+snippet&q=10&type=video&videoSyndicated=true&key= {YOUR_API_KEY} 您可以使用API Explorer尝试不同的组合: https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=id%252C+snippet&q=10&type=video&videoSyndicated=true&_h=1&