从Youtube数据API搜索结果提要中,如何确定视频是否显示版权信息而不播放?

从Youtube数据API搜索结果提要中,如何确定视频是否显示版权信息而不播放?,youtube,youtube-api,Youtube,Youtube Api,我正在使用数据API执行搜索。有时,当我尝试显示视频结果时,会收到以下类型的消息: 此视频包含来自EMI的内容, 谁在你的国家阻止了它 版权理由 如何从搜索结果中确定视频是否不会播放并显示此消息 以下是我正在进行的搜索示例: http://gdata.youtube.com/feeds/api/videos?q=Explosions+in+the+Sky+So+Long++Lonesome 这里是第一个结果,我试图显示并获得版权信息: {"id"=>"http://gdata.youtu

我正在使用数据API执行搜索。有时,当我尝试显示视频结果时,会收到以下类型的消息:

此视频包含来自EMI的内容, 谁在你的国家阻止了它 版权理由

如何从搜索结果中确定视频是否不会播放并显示此消息

以下是我正在进行的搜索示例:

http://gdata.youtube.com/feeds/api/videos?q=Explosions+in+the+Sky+So+Long++Lonesome
这里是第一个结果,我试图显示并获得版权信息:

{"id"=>"http://gdata.youtube.com/feeds/api/videos/jotDBl1vilg", "published"=>"2009-01-24T00:08:01.000Z", "updated"=>"2011-07-05T21:57:58.000Z", "category"=>[{"scheme"=>"http://schemas.google.com/g/2005#kind", "term"=>"http://gdata.youtube.com/schemas/2007#video"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/categories.cat", "term"=>"Music", "label"=>"Music"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"explosions"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"in"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"the"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"sky"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"so"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"long"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"lonesome"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"eits"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"indie"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"rock"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"instrumental"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"austin"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"texas"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"music"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"video"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"solar"}, {"scheme"=>"http://gdata.youtube.com/schemas/2007/keywords.cat", "term"=>"system"}], "title"=>"explosions in the sky - \"so long, lonesome\"", "content"=>"jakefyfe.tumblr.com watch in high quality. \"so long, lonesome\" i didn't realize until now how many videos were already on youtube for this song. im going to leave it up anyway.", "link"=>[{"rel"=>"alternate", "type"=>"text/html", "href"=>"http://www.youtube.com/watch?v=jotDBl1vilg&feature=youtube_gdata"}, {"rel"=>"http://gdata.youtube.com/schemas/2007#video.responses", "type"=>"application/atom+xml", "href"=>"http://gdata.youtube.com/feeds/api/videos/jotDBl1vilg/responses"}, {"rel"=>"http://gdata.youtube.com/schemas/2007#video.related", "type"=>"application/atom+xml", "href"=>"http://gdata.youtube.com/feeds/api/videos/jotDBl1vilg/related"}, {"rel"=>"http://gdata.youtube.com/schemas/2007#mobile", "type"=>"text/html", "href"=>"http://m.youtube.com/details?v=jotDBl1vilg"}, {"rel"=>"self", "type"=>"application/atom+xml", "href"=>"http://gdata.youtube.com/feeds/api/videos/jotDBl1vilg"}], "author"=>{"name"=>"jakefyfe", "uri"=>"http://gdata.youtube.com/feeds/api/users/jakefyfe"}, "comments"=>{"feedLink"=>{"href"=>"http://gdata.youtube.com/feeds/api/videos/jotDBl1vilg/comments", "countHint"=>"43"}}, "group"=>{"category"=>"Music", "content"=>[{"url"=>"http://www.youtube.com/v/jotDBl1vilg?f=videos&app=youtube_gdata", "type"=>"application/x-shockwave-flash", "medium"=>"video", "isDefault"=>"true", "expression"=>"full", "duration"=>"247", "yt:format"=>"5"}, {"url"=>"rtsp://v6.cache1.c.youtube.com/CiILENy73wIaGQlYim9dBkOLjhMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp", "type"=>"video/3gpp", "medium"=>"video", "expression"=>"full", "duration"=>"247", "yt:format"=>"1"}, {"url"=>"rtsp://v6.cache1.c.youtube.com/CiILENy73wIaGQlYim9dBkOLjhMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp", "type"=>"video/3gpp", "medium"=>"video", "expression"=>"full", "duration"=>"247", "yt:format"=>"6"}], "description"=>"jakefyfe.tumblr.com watch in high quality. \"so long, lonesome\" i didn't realize until now how many videos were already on youtube for this song. im going to leave it up anyway.", "keywords"=>"explosions, in, the, sky, so, long, lonesome, eits, indie, rock, instrumental, austin, texas, music, video, solar, system", "player"=>{"url"=>"http://www.youtube.com/watch?v=jotDBl1vilg&feature=youtube_gdata_player"}, "restriction"=>"AU NZ","thumbnail"=>[{"url"=>"http://i.ytimg.com/vi/jotDBl1vilg/0.jpg", "height"=>"240", "width"=>"320", "time"=>"00:02:03.500"}, {"url"=>"http://i.ytimg.com/vi/jotDBl1vilg/1.jpg", "height"=>"90", "width"=>"120", "time"=>"00:01:01.750"}, {"url"=>"http://i.ytimg.com/vi/jotDBl1vilg/2.jpg", "height"=>"90", "width"=>"120", "time"=>"00:02:03.500"}, {"url"=>"http://i.ytimg.com/vi/jotDBl1vilg/3.jpg", "height"=>"90", "width"=>"120", "time"=>"00:03:05.250"}], "title"=>"explosions in the sky - \"so long, lonesome\"", "duration"=>{"seconds"=>"247"}}, "rating"=>{"average"=>"4.962766", "max"=>"5", "min"=>"1", "numRaters"=>"188", "rel"=>"http://schemas.google.com/g/2005#overall"}, "statistics"=>{"favoriteCount"=>"450", "viewCount"=>"57066"}}

在这个结果中,什么会表明视频无法播放?

我想你是想找一个

例如,尝试以下方法:

http://gdata.youtube.com/feeds/api/videos/jotDBl1vilg?fields=media:group/media:restriction&alt=json

对于youtube api v3,videoLicense字段有三个可能的参数,请使用其中一个:

videoLicense=any
videoLicense=creativeCommon
videoLicense=youtube
这是一个开始,如果你可以在youtube上播放它的想法。如果您在youtube之外使用该查询,请尝试使用videoSyndicated查询

videoSyndicated=true
允许您搜索可以在youtube之外播放的视频,比如在使用youtube的移动应用程序中

有关更多信息,请查看参考资料: