Get the most viewed videos from a channel and get

2019-08-11 05:08发布

After finally getting the API to connect properly after a couple of hiccups I've managed to grab pretty much all of the data I need fairly easily with 2 exceptions:

I need a list of the 10 most viewed videos from a specific channel. I know with video.list you can set the chart to most popular, but setting the videoCategoryId to either the channel id or the playlist id of the channel's uploads doesn't seem to work

I also need to grab the video that is featured on the channel's home page. I think this is referred to in the API as unsubscribedTrailer and is available under brandingSettings but can't find a way to get at the value from the result of channels.list

EDIT: I've also tried adding brandingSettings to the parts string of listChannels but it returns an empty object - I assume as I'm not the owner of the channel even though I only want to read them and not update

标签: youtube-api
1条回答
仙女界的扛把子
2楼-- · 2019-08-11 05:57

videos->list call is for getting details about videos you already found.

What you need is to do a channels->list with id to find properties of that channels.

The featured video is: brandingSettings.channel.unsubscribedTrailer

To get get most popular videos of that channel: you can do search->list with specifying the channelId and order = viewcount

查看更多
登录 后发表回答