Note that there are some explanatory texts on larger screens.

plurals
  1. POInvalid Request on YouTube video upload with Zend Gdata
    primarykey
    data
    text
    <p>I have the following code that returns HTTP error 400 everytime I try to execute it.</p> <pre><code> $file = "/home/.../videos/bigbuckbunny.mp4"; $title = "This is a test"; $category = "Film"; $description = "test"; $keywords = "test, film, big buck"; Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Gdata_YouTube'); Zend_Loader::loadClass('Zend_Gdata_App_HttpException'); $httpClient = Zend_Gdata_ClientLogin::getHttpClient($this-&gt;settings['username'], $this-&gt;settings['password'], 'youtube', NULL, 'Test Client'); $this-&gt;youTube = new Zend_Gdata_YouTube($httpClient, 'Test Client', 'Videos Plugin', $this-&gt;settings['key']); $this-&gt;youTube-&gt;setMajorProtocolVersion(2); $entry = new Zend_Gdata_YouTube_VideoEntry(); $fileSource = $this-&gt;youTube-&gt;newMediaFileSource($file); $fileSource-&gt;setContentType(mime_content_type($file)); $fileSource-&gt;setSlug(basename($file)); $entry-&gt;setMediaSource($fileSource); $entry-&gt;setVideoCategory($category); $entry-&gt;setVideoTitle($title); $entry-&gt;setVideoDescription($description); $entry-&gt;setVideoTags($keywords); try { $uploadUrl = 'http://uploads.gdata.youtube.com/feeds/users/default/uploads'; $newEntry = $this-&gt;youTube-&gt;insertEntry($entry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry'); } catch(Zend_Gdata_App_HttpException $e) { var_dump($e-&gt;getResponse()); return NULL; } </code></pre> <p>My settings are correct. The exception is the following:</p> <pre><code>object(Zend_Http_Response)#362 (5) { ["version:protected"]=&gt; string(3) "1.1" ["code:protected"]=&gt; int(400) ["message:protected"]=&gt; string(11) "Bad Request" ["headers:protected"]=&gt; array(9) { ["Server"]=&gt; string(61) "HTTP Upload Server Built on Mar 22 2012 14:54:02 (1332453242)" ["Content-type"]=&gt; string(24) "text/html; charset=UTF-8" ["X-guploader-uploadid"]=&gt; string(98) "AEnB2UoljS9KYUftPEhuRV8hVssGvOHcR1mcK0rfhMOGTBkUYSxX29iKpO9vHisG10EYxQE0-rul3rVEbd2YJlFiXCbaGBpUpQ" ["Date"]=&gt; string(29) "Fri, 23 Mar 2012 18:36:46 GMT" ["Pragma"]=&gt; string(8) "no-cache" ["Expires"]=&gt; string(29) "Fri, 01 Jan 1990 00:00:00 GMT" ["Cache-control"]=&gt; string(35) "no-cache, no-store, must-revalidate" ["Content-length"]=&gt; string(2) "15" ["Connection"]=&gt; string(5) "close" } ["body:protected"]=&gt; string(15) "Invalid Request" } </code></pre> <p>Does anyone have any idea? I got it working before, now it doesn't seem to work.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload