javascript - 区分 Youtube-Google 关联帐户与未关联帐户

标签 javascript youtube-api youtube-javascript-api

如何区分 Youtube-Google 链接帐户与未与 Youtube API 链接的帐户。通过发送此请求成功检索有关当前登录用户的信息后:

https://gdata.youtube.com/feeds/api/users/default?v=2?access_token=YSECURITY_TOKEN&alt=json

我得到包含用户信息的 JSON 结构。但没有任何属性表明该用户是否已链接或取消链接谷歌帐户。通过搜索 Youtube API 文档和谷歌搜索,我找不到直接答案,只能找到如何进入此页面,您可以在其中检查您的帐户是否已链接:

http://support.google.com/youtube/bin/answer.py?hl=en&answer=69964

我正在使用 javascript 和 jQuery。

最佳答案

看来我找到了。描述 API 版本 2.0 和 2.1 之间差异的 Youtube API 文档部分说道:

In version 2.1, a YouTube user profile entry for a user with an unlinked Google Account will contain a <yt:incomplete> tag. This tag is useful if you prefer to modify your application so that it does not display unsupported features (or provides a different display for those features) to users with unlinked Google Accounts.

In addition, in version 2.1, a profile entry for a user with an unlinked Google Account only contains a few of the tags that can be included in a profile entry for a user with a YouTube account. The <entry> tag definition lists the tags that may appear within a profile entry for both YouTube accounts and unlinked Google Accounts.

这样我就可以搜索是否存在不完整的标签。

关于javascript - 区分 Youtube-Google 关联帐户与未关联帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11063536/

相关文章:

android - 从 WebView 播放 youtube 视频

javascript - 如何让这个 jQuery Youtube 弹出窗口在我的本地网站上运行?

javascript - 从本地存储动态重新填充表行

javascript - 如何构建正则表达式以匹配引号中的字符串?

youtube - 在 YouTube 上上传视频(通过 API),但仅在我的网站上可见

ruby - Youtube_It示例代码绘制参数错误

javascript - 使用 youtube api v3 使用 javascript 从视频中获取标题

ios - 以编程方式强制 UIWebView 进入全屏模式

javascript - org.openqa.selenium.WebDriverException : unknown error: Runtime. 评估抛出异常:SyntaxError:缺少)在参数列表之后

javascript - 如何根据条件更改文本颜色?