So, I am able to upload a video to YouTube (direct upload) using the PHP client library and set it to private, but is it possible to set it as unlisted?
Go to the Video Manager and click on the video. 2. Go to Edit. Under Basic Information, you'll see the option to mark your video as “unlisted,” “public,” or “private.” Select unlisted.
Unlisted videos. Unlisted videos and playlists can be seen and shared by anyone with the link. Your unlisted videos won't appear in the Videos tab of your channel homepage. They won't show up in YouTube's search results unless someone adds your unlisted video to a public playlist. You can share an unlisted video's URL.
Unlisted means your video will not come up in search results or on your channel either. Only those who know the link can view it, and you can share the link with anyone, even those who do not have a YouTube account/username. This means that this video could still be seen by anyone, but only if they guess the link!
You must use this code as a child of the XML element of the request:
<yt:accessControl action="list" permission="denied"/>
If you can't add it manually (usually using zend) you may use this code to add the corresponding zend entry:
//Creates an extension to Zend Framework
$element = new Zend_Gdata_App_Extension_Element('yt:accessControl', 'yt', 'http://gdata.youtube.com/schemas/2007', '');
//Adds the corresponding XML child/attribute
$element->extensionAttributes = array(array('namespaceUri' => '', 'name' => 'action', 'value' => 'list'), array('namespaceUri' => '', 'name' => 'permission', 'value' => 'denied'));
//Adds this extension to you video entry where "$myVideo" is your video to be uploaded
$myVideo->extensionElements = array($element);
Hope this helps :D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With