How to programmatically find out what channels are part of a given YouTube network?

我的梦境 提交于 2019-11-30 09:02:15

I don't know if this is the way sites such as socialblade or channelmeter get the networked channels. But this is the way i did it.

Say i visit this video link: http://www.youtube.com/watch?v=_8AZT40gH5E

In the meta tags information of a networked channel, there is an attribute <meta name=attribution content=JamieOliver/> (As example) which actually specifies the network that channel belongs to. So what i did was one video from the channel i'm working with, and use a small function like this:

$tags = get_meta_tags("http://www.youtube.com/watch?v=_8AZT40gH5E");
echo $network = $tags['attribution'];

And you have the Network the channel is associated with.

It doesn't look like you can get this information using the v3 API at this time, but I believe what socialblade is calling networks is the content owner or 'Partner Name'.

In an API response, a feed entry contains a partner video if the entry contains a <media:credit> tag for which the value of the yt:type attribute is partner. <media:credit role='uploader' scheme='urn:youtube' yt:display='partner_name' yt:type='partner'>partner_name</media:credit>

Described here: https://developers.google.com/youtube/2.0/reference#Video_Feeds

It's probably just a matter of assigning channels which only contain videos by a distinct partner to that partner's 'network'. (Or just as likely any videos.)

Edit: Since that demonstrably appears not to be accurate, I'll point out that it appears the analytics API does have that information, but from the description it sounds like it only allows reports on channels your own "network". That being said, SocialBlade has to be getting their information about other networks from somewhere:

Content owners who participate in the YouTube Partner Program can also use the API to retrieve reports that aggregate Analytics data for all YouTube channels that are linked to their content owner account.

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