Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>FYI, the above example won't work, but it's close. You need to send fake cookies. So basically when you visit the page with the XML, you need to grab the cookies, and then send those cookies you previously received while visiting the final video url. So here's how you do it in PHP (using Yii) with curl:</p> <pre><code>public function actionVimeo($video_id) { $xml_url = "http://vimeo.com/moogaloop/load/clip:$video_id"; $ch = curl_init($xml_url); $cookieFile = Yii::app()-&gt;basePath . '/runtime/vimeocookie'. time().'.txt'; //replace this line with code to generate a writeable path in your application curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile); //the cookie file will be populated with cookies received while viewing the xml page curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); //you need to send a user agent here and it must be the same below when you visit the video url curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($ch); curl_close($ch); $xml = simplexml_load_string($output); $request_signature = $xml-&gt;request_signature; $request_signature_expires = $xml-&gt;request_signature_expires; $vid_url = "http://vimeo.com/moogaloop/play/clip:".$video_id."/".$request_signature."/".$request_signature_expires."/?q=sd"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$vid_url); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); //same user agent as on previous vimeo page you visited curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile); //the cookies in that cookie file will be used while visiting the video URL curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); //vimeo changes the header location, so you gotta follow it curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $video = curl_exec($ch); curl_close($ch); unlink($cookieFile); //remove the temporary cookie file $savePath = Yii::app()-&gt;basePath . '/runtime/testvim.mp4'; //change this to a path your application can write the final video to file_put_contents($savePath, $video); exit; } </code></pre>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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