Google YouTube API (v3): how to access my unlisted/private videos from my server?

耗尽温柔 提交于 2019-12-11 13:23:29

问题


I've been experimenting with Google YouTube API (v3).
Until today, I used it with public videos.
Now I have the requirement to work with unlisted videos (for example, retrieve the list of my uploaded videos on a channel).
I see in the docs I should use google-api-php-client libraries.
This library requires an OAuth 2.0 client ID. This library requires interactive authorization from client (it's oauth2, of course. Actually in the code samples is always included an html section.

Now the question is:

I need to access to my unlisted (or private, possibly) videos server-side: I would need an unattended, server-to-server kind of authentication. Is it possible? If it is, then how?


回答1:


You can save a refresh token in your server and request new access tokens from there going forward.

Otherwise, only if you have access to Content ID API, you can use service accounts and onBehalfofContentOwner parameter instead.



来源:https://stackoverflow.com/questions/32996760/google-youtube-api-v3-how-to-access-my-unlisted-private-videos-from-my-server

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