cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

libcurl with redirects not working for google video, works with curl

From: Tim Schwartz <timatron_at_gmail.com>
Date: Sun, 4 Jun 2006 20:55:12 -0400

Hello all,

I've been trying to use libcurl in php to download the actual flv files from
google video, i can get it to work quite easily with the command line tool,
but with libcurl in php it dont work none:( any ideas?

if you open the url in firefox it will downlaod it.

thx!
-tim

Example:

this doesnt work -->

<?php

$url = "
http://vp.video.google.com/videodownload?version=0&secureurl=tAAAAG7ggqAHSiJjpW0D3w4aYTWMt8S_dC2375mvvA8BjcduktxqIrT1TDF0HVE8bMJAdlIcqXmD9ObiGuRECCtbh-0mK8t-CmJG_YY52J9PQrZpomgh-WN_YOFz2yhmRDzUNFGiyu-O7lzYzyzspOX6vrf5qwmwNwW5udIplPwm-1CyiO5hiXtcw0FSxhzciEU3kEHUk5pNkh8TtmD0xjOHLT5elw9oh0HL4MVwd6PloHIDLZ4E6fGWfHqimwxWBtJxnQ&sigh=LDVIawBhi0Yh7-x_bkLfGwEFoNM&begin=0&len=265099&docid=-8627390594491892243
";

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
$data = curl_exec($ch);
print_r(curl_getinfo($ch));
curl_close($ch);

echo $data;

?>

this works -->

curl -L "
http://vp.video.google.com/videodownload?version=0&secureurl=tAAAAG7ggqAHSiJjpW0D3w4aYTWMt8S_dC2375mvvA8BjcduktxqIrT1TDF0HVE8bMJAdlIcqXmD9ObiGuRECCtbh-0mK8t-CmJG_YY52J9PQrZpomgh-WN_YOFz2yhmRDzUNFGiyu-O7lzYzyzspOX6vrf5qwmwNwW5udIplPwm-1CyiO5hiXtcw0FSxhzciEU3kEHUk5pNkh8TtmD0xjOHLT5elw9oh0HL4MVwd6PloHIDLZ4E6fGWfHqimwxWBtJxnQ&sigh=LDVIawBhi0Yh7-x_bkLfGwEFoNM&begin=0&len=265099&docid=-8627390594491892243
"

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-06-05