YouTube API未列出频道

时间:2019-09-30 16:31:18

标签: youtube youtube-api youtube-data-api

我正在使用YouTube数据API从频道中获取有关视频的信息。 API响应不包括上传到相应频道的所有视频。

这是频道(目前有6个视频): https://www.youtube.com/channel/UCdSjDEx46aNP0oKPN_J6hOA/videos

视频列表(现在):https://i.ibb.co/K91bJxS/image.png

这是我的API调用: https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&key=API_KEY&maxResults=15&channelId=UCdSjDEx46aNP0oKPN_J6hOA&order=date

以下是回复(仅列出了4个视频):

  

{       “ kind”:“ youtube#searchListResponse”,       “ etag”:“ \” p4VTdlkQv3HQeTEaXgvLePAydmU / be7hxSCsiJnKBCJePUfIg5bfJO4 \“,”       “ regionCode”:“ RO”,       “ pageInfo”:{           “ totalResults”:4,           “ resultsPerPage”:15       },       “项目”:[           {               “ kind”:“ youtube#searchResult”,               “ etag”:“ \” p4VTdlkQv3HQeTEaXgvLePAydmU / ntdnt3QTuNN5l9_iYJAAgH4kE-w \“”,               “ID”:{                   “ kind”:“ youtube#video”,                   “ videoId”:“ GkYNJH0qkKc”               },               “摘要”:{                   “ publishedAt”:“” 2019-09-29T07:47:58.000Z“,                   “ channelId”:“ UCdSjDEx46aNP0oKPN_J6hOA”,                   “ title”:“ Tument comentado 3/3”,                   “ description”:“ Comentamos el tutorial de MTG Arena para quien no lo haya jugadonunca。Damosexplicacionesútilespara jugadores小说。”,                   “缩略图”:{                       “默认”:{                           “ url”:“ https://i.ytimg.com/vi/GkYNJH0qkKc/default.jpg”,                           “宽度”:120,                           “身高”:90                       },                       “介质”:{                           “ url”:“ https://i.ytimg.com/vi/GkYNJH0qkKc/mqdefault.jpg”,                           “宽度”:320,                           “身高”:180                       },                       “高”:{                           “ url”:“ https://i.ytimg.com/vi/GkYNJH0qkKc/hqdefault.jpg”,                           “宽度”:480,                           “身高”:360                       }                   },                   “ channelTitle”:“汽车吧”,                   “ liveBroadcastContent”:“无”               }           },           {               “ kind”:“ youtube#searchResult”,               “ etag”:“ \” p4VTdlkQv3HQeTEaXgvLePAydmU / w_3YGOA4SdmMgL15Fzg1qQaAQQo \“,”               “ID”:{                   “ kind”:“ youtube#video”,                   “ videoId”:“ OHLTiXWJ9pM”               },               “摘要”:{                   “ publishedAt”:“” 2019-09-29T07:44:03.000Z“,                   “ channelId”:“ UCdSjDEx46aNP0oKPN_J6hOA”,                   “ title”:“ Tument comentado 2/3”,                   “ description”:“ Comentamos el tutorial de MTG Arena para quien no lo haya jugadonunca。Damosexplicacionesútilespara jugadores小说。”,                   “缩略图”:{                       “默认”:{                           “ url”:“ https://i.ytimg.com/vi/OHLTiXWJ9pM/default.jpg”,                           “宽度”:120,                           “身高”:90                       },                       “介质”:{                           “ url”:“ https://i.ytimg.com/vi/OHLTiXWJ9pM/mqdefault.jpg”,                           “宽度”:320,                           “身高”:180                       },                       “高”:{                           “ url”:“ https://i.ytimg.com/vi/OHLTiXWJ9pM/hqdefault.jpg”,                           “宽度”:480,                           “身高”:360                       }                   },                   “ channelTitle”:“汽车吧”,                   “ liveBroadcastContent”:“无”               }           },           {               “ kind”:“ youtube#searchResult”,               “ etag”:“ \” p4VTdlkQv3HQeTEaXgvLePAydmU / RE4dR9kF05E34eOpiVOGKgkIs4g \“,”               “ID”:{                   “ kind”:“ youtube#video”,                   “ videoId”:“ j9QQVjakiCM”               },               “摘要”:{                   “ publishedAt”:“” 2019-09-29T07:25:42.000Z“,                   “ channelId”:“ UCdSjDEx46aNP0oKPN_J6hOA”,                   “ title”:“ Tument comentado 1/3”,                   “ description”:“ Comentamos el tutorial de MTG Arena para quien no lo haya jugadonunca。Damosexplicacionesútilespara jugadores小说。”,                   “缩略图”:{                       “默认”:{                           “ url”:“ https://i.ytimg.com/vi/j9QQVjakiCM/default.jpg”,                           “宽度”:120,                           “身高”:90                       },                       “介质”:{                           “ url”:“ https://i.ytimg.com/vi/j9QQVjakiCM/mqdefault.jpg”,                           “宽度”:320,                           “身高”:180                       },                       “高”:{                           “ url”:“ https://i.ytimg.com/vi/j9QQVjakiCM/hqdefault.jpg”,                           “宽度”:480,                           “身高”:360                       }                   },                   “ channelTitle”:“汽车吧”,                   “ liveBroadcastContent”:“无”               }           },           {               “ kind”:“ youtube#searchResult”,               “ etag”:“ \” p4VTdlkQv3HQeTEaXgvLePAydmU / 56JGSQ25cLzFPdVa5Mk-Y63hHC0 \“,”               “ID”:{                   “ kind”:“ youtube#video”,                   “ videoId”:“ 46dml09YB1E”               },               “摘要”:{                   “ publishedAt”:“” 2019-09-28T07:30:01.000Z“,                   “ channelId”:“ UCdSjDEx46aNP0oKPN_J6hOA”,                   “ title”:“ Presentacion版本Septiembre 2019”,                   “说明”:“ MTG竞技场官方版本1.0的版本更新。”,                   “缩略图”:{                       “默认”:{                           “ url”:“ https://i.ytimg.com/vi/46dml09YB1E/default.jpg”,                           “宽度”:120,                           “身高”:90                       },                       “介质”:{                           “ url”:“ https://i.ytimg.com/vi/46dml09YB1E/mqdefault.jpg”,                           “宽度”:320,                           “身高”:180                       },                       “高”:{                           “ url”:“ https://i.ytimg.com/vi/46dml09YB1E/hqdefault.jpg”,                           “宽度”:480,                           “身高”:360                       }                   },                   “ channelTitle”:“汽车吧”,                   “ liveBroadcastContent”:“无”               }           }       ]   }

对此有任何帮助。

谢谢。

1 个答案:

答案 0 :(得分:1)

正如问题跟踪器中对此answer所述,

您可以使用以下一系列呼叫作为解决方法:

  

1)使用Channels.list获取上传播放列表:

     

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=contentDetails&id=UCupvZG-5ko_eiXAupbDfxWw&fields=items(contentDetails%252FrelatedPlaylists%252Fuploads%252Cid)&_h=12&

     

2)然后使用playlistitems.list获取最新视频:

     

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.playlistItems.list?part=snippet&playlistId=UUHnyfMqiRRG1u-2MsSQLbXA&_h=6&

该系列的通话效率更高,因为它使用的配额减少了90%。