Fetching videos from auto generated channel in YouTube api

為{幸葍}努か 提交于 2019-12-03 17:34:59

auto generated channels has not videos. They have only playlists with videos from other channels. so you have to look for playlists.

I have a similar work like this issue.

My target channel is "Live" channel (https://www.youtube.com/channel/UC4R8DWoMoI7CAwX8_LjQHig)

What I have done for now is using the following v3 API https://www.googleapis.com/youtube/v3/channelSections?part=snippet%2C+contentDetails&channelId=UC4R8DWoMoI7CAwX8_LjQHig&hl=zh-TW&key={YOUR_API_KEY}

We can get many items with the part as "contentDetails"

"contentDetails": {
  "playlists": [
   "PLU12uITxBEPEEIlLMEWFXvAeoZl0cSrok"
  ]
}

And then we can request "PlaylistItems" API to get videos for each playlist.

It works with normal channels to get its homepage information. However, for "Live" channel, it does return something, but differs from the browser's (Chrome's) results.

I'd want to know if there is a better solution of parsing videos for YouTube auto-generated channel .

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!