Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload video to YouTube as unlisted

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?

like image 461
John Avatar asked Jun 06 '11 17:06

John


People also ask

How do you upload a video to YouTube 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.

What does it mean to upload a video as unlisted on YouTube?

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.

What happens when a YouTube video is unlisted?

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!


1 Answers

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

like image 192
JDuarteDJ Avatar answered Sep 20 '22 05:09

JDuarteDJ