我想编写一个代码来检索与特定播放列表相关的所有视频。我应该使用什么查询?例如:我用过
" https://gdata.youtube.com/feeds/api/videos?author= "+username+"&v=2&alt=jsonc&max-results=3" 查询获取用户相关的所有视频。
“用户名”字段从编辑文本中获取值。
我想编写一个代码来检索与特定播放列表相关的所有视频。我应该使用什么查询?例如:我用过
" https://gdata.youtube.com/feeds/api/videos?author= "+username+"&v=2&alt=jsonc&max-results=3" 查询获取用户相关的所有视频。
“用户名”字段从编辑文本中获取值。
你可以像你写的那样使用查询:http://gdata.youtube.com/feeds/api/videos?author="+username+"&v=2&alt=json
首先,对于特定的播放列表,请研究这个关于获取播放列表的链接。 https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists
您可以获取 xml 格式的播放列表:https ://gdata.youtube.com/feeds/api/users/thenewboston/playlists?v=2
如果你想在 json 中追加 &alt=json 来查询。此链接将为您提供播放列表。
并使用这样的 URL 获取播放列表的项目:https ://gdata.youtube.com/feeds/api/playlists/8BCDD04DE8F771B2?v=2
要获取 Json 数据中的播放列表项,您必须获取此节点:
"content": {
"type": "application/atom+xml;type=feed",
"src": "https://gdata.youtube.com/feeds/api/playlists/PL6gx4Cwl9DGCS7sMM-19z9_ud7F2SINJq?v=2
},
此节点来自 thenewboston 的播放列表数据。您可以找到有关 Youtube API 和播放列表的更多信息,请查看此链接:https ://developers.google.com/youtube/2.0/developers_guide_protocol_playlists和检索单个播放列表标题。