如何通过 API 确定 Youtube 频道是否自动生成 [英] How To Determine If Youtube Channel is auto generated or not through API

查看:30
本文介绍了如何通过 API 确定 Youtube 频道是否自动生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过 Gnip 获取 YouTube XML 数据的提要.这是他们的 v2.0 API.我需要弄清楚消息的来源是来自具有真实用户 ID 的真实用户还是具有自动生成 ID 的自动生成用户.用肉眼观察,很明显哪个是真实 ID,哪个是自动生成的,但我在 XML 中没有看到表明用户是真实的还是自动生成的字段.

I'm getting a feed of youtube XML data through Gnip. It's their v2.0 API. I need to figure out if the source of the message is from a real user with a real user ID or is an auto generated user with an auto generated ID. Looking at it by eye, it's pretty obvious which one is a real ID and which one is auto generated but I see no fields in the XML that indicates whether the user is real or auto generated.

示例:自动生成:http://www.youtube.com/channel/5l8cCviw5TIKtWo9VKhfZQ真实:http://www.youtube.com/{真实用户名}

Example: auto generated: http://www.youtube.com/channel/5l8cCviw5TIKtWo9VKhfZQ real: http://www.youtube.com/{real user name}

通过链接也可以看出区别,因为一个包含频道"一词,而另一个不包含.但是,我没有从 XML 提要中获取此信息.我只能得到他们的用户名,它要么是真实的名字,要么是自动生成的.我如何区分这两个?

The difference is also obvious through the link because one contains the word "channel" while the other does not. However, I do not get this information from the XML feed. I can only get their user name which is either a real name or an auto generated one. How do I distinguish between the 2?

推荐答案

我认为您认为一个是真实的"而另一个是自动生成的假设是不正确的.据我所知,http://www.youtube.com/channel/5l8cCviw5TIKtWo9VKhfZQ 是真实用户的频道.只是用户拥有 Google+ 身份,而不是 YouTube 用户名.这篇博文对此进行了更多解释:http://apiblog.youtube.com/2012/03/youtube-google-api-and-you.html

I think your assumption that one is "real" and the other is auto-generated is incorrect. As far as I can tell, http://www.youtube.com/channel/5l8cCviw5TIKtWo9VKhfZQ is a real user's channel. It's just that the user has a Google+ identity, and not a YouTube username. This is explained a bit more in this blog post: http://apiblog.youtube.com/2012/03/youtube-google-api-and-you.html

我的主要问题是你为什么需要区分?如果您只使用用户 ID,您应该能够以相同的方式对待任一类型的频道 - 即使与 YouTube 用户名相关联的频道也有用户 ID.

My main question is why do you need to distinguish? If you work solely with user ids, you should be able to treat either type of channel identically—even channels associated with YouTube usernames have user ids as well.

这篇关于如何通过 API 确定 Youtube 频道是否自动生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆