I was able to replicate this problem in the OAuth 2.0 Playground by authenticating with an account that doesn't have a YouTube channel/username, and calling the Get User method (https://gdata.youtube.com/feeds/api/users/default).
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It is possible to have a YouTube account without having a YouTube channel (i.e. having a YouTube username). Google calls this an unlinked account.
Some methods defined in version 2.0 of the YouTube API will throw 401 Unauthorized errors if you call them on an unlinked account. It turns out that there is a relatively undocumented version of the YouTube API (version 2.1) that enables functionality for unlinked accounts.
More info: http://apiblog.youtube.com/2011/10/introducing-google-account-support-and.html
I was able to fix the error in the OAuth 2.0 Playground by simply changing the version header from GData-Version: 2.0
to GData-Version: 2.1
.
标签:
youtube-api