How can I set videos to “private yet shared” using the v3 YouTube API?

萝らか妹 提交于 2019-12-04 18:22:01

问题


I work for a school that has an institutional YouTube account (Google Apps for Education). The video privacy options are Public, Unlisted, and Private.

The important bit: Private videos can be shared with either: - the institution (i.e., all students with a school account), or - a list of specific email addresses.

We have a tool that uses the v3 YouTube API (Java) to automatically upload videos to YouTube.

I can use the API to set privacy:

VideoStatus videoStatus = new VideoStatus();
videoStatus.setPrivacyStatus("private");

But how do I set sharing (e.g., "Shared with school.edu") using the YouTube API? I assume it's possible because it can be done (manually) using YouTube's online Video Manager.


回答1:


It seems more people are being left in the dark about this, but most questions date from some years ago.

E.g.: YouTube API: Private Video Access which links to a YT dev reaction: https://groups.google.com/forum/#!topic/youtube-api-gdata/LkfDtwxjWp8/discussion (May 2012)

There is not, unfortunately, and I don't believe that specific functionality will be added.

Moreover the bug JAL linked to dates from April 2014, so it seems like private video's come with their own set of problems.

To conclude, I'll be sticking to the unlisted video approach, which seems like a good trade-off for me. I can return the unlisted video's for my own set of users, which gives me control on that level. If some user feels like mailing around the YouTube link, that's just too bad. As the aforementioned link states:

Sometimes, security is about compromise. At one end of the spectrum, you can lock things down completely so that no one can access the data. At the other end, the most usable and accessible data will not be secure.




回答2:


After reviewing the YouTube Data API v3 documentation, I have come to the conclusion that this is not possible with the current API.

This may be related to Issue 6265 that is currently reported as an API defect. If this does not address your use case I strongly suggest you file an enhancement ticket to gdata-issues.



来源:https://stackoverflow.com/questions/37579534/how-can-i-set-videos-to-private-yet-shared-using-the-v3-youtube-api

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