3
votes

Im trying to get all videos from YouTube auto-generated channel (AKA Topic). I let my users add a link to the YT channel and I am sending the channel ID to retrieve videos.

On regular case, when the channel is NOT auto-generate I am using this endpoint: https://www.googleapis.com/youtube/v3/channels?part=snippet&channelId={channel_id}&key={key}

This endpoint return a list of videos that posted into this channel. The problem with topic is that the list of videos return empty...

example for this following request: https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCYF2FotHeGO6cNcldrTHN1g&key={YOUR_API_KEY}

{
 "kind": "youtube#searchListResponse",
 "etag": "\"3enKTWw-I-yugKAPnlrhH5U04vQ/Zi7b6FbLUH9xd8vhDiVs3zpfKLs\"",
 "pageInfo": {
  "totalResults": 1,
  "resultsPerPage": 5
 },
 "items": [
  {
   "kind": "youtube#searchResult",
   "etag": "\"3enKTWw-I-yugKAPnlrhH5U04vQ/dkWBa22byHoKTpuDJQLPs5T6ndg\"",
   "id": {
    "kind": "youtube#channel",
    "channelId": "UCYF2FotHeGO6cNcldrTHN1g"
   },
   "snippet": {
    "publishedAt": "2013-12-21T05:18:21.000Z",
    "channelId": "UCYF2FotHeGO6cNcldrTHN1g",
    "title": "Manchester United F.C. - Topic",
    "description": "Manchester United Football Club is an English football club based in Old Trafford, Greater Manchester. The club was formed as Newton Heath LYR Football ...",
    "thumbnails": {
     "default": {
      "url": "https://i.ytimg.com/i/YF2FotHeGO6cNcldrTHN1g/1.jpg"
     },
     "medium": {
      "url": "https://i.ytimg.com/i/YF2FotHeGO6cNcldrTHN1g/mq1.jpg"
     },
     "high": {
      "url": "https://i.ytimg.com/i/YF2FotHeGO6cNcldrTHN1g/hq1.jpg"
     }
    },
    "channelTitle": "",
    "liveBroadcastContent": "none"
   }
  }
 ]
}

Any idea how to get Topic videos?

Thanks

2
Did you find a solution? I ran into this issue now.Manas Paldhe

2 Answers

0
votes

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

0
votes

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 .