i m using phptube class for downloading you tube video.
In code i paste youtube url on a input box but there is errors below.
Warning: file_get_contents(http://www.youtube.com/get_video?video_id=&t=)
[function.file-get-contents]: failed to open stream: HTTP request failed!
HTTP/1.0 404 Not Found
and
Warning: file_put_contents(./flvs/3Hx9VsqMUug.flv) [function.file-put-contents]:
failed to open stream: No such file or directory in E:\xampp\htdocs\vdo\utube
\functions.php on line 19
path:./flvs/3Hx9VsqMUug.flv
please tell me where is problem???
UPDATE:
here is main code
$url = "http://www.youtube.com/watch?v=".$video_id;
//where $video_id=nlZJ7RsyC0g
$this->req =& new HTTP_Request($url);
//echo "<pre>";
//print_r($this->req);
//echo "</pre>";
//die;
$response = $this->req->sendRequest();
//echo $response; die;
if (PEAR::isError($response)) {
//echo "inside if";
$response->getMessage()."\n";
} else {
//echo "inside else";
$page = $this->req->getResponseBody();
//print_r($page);
//var_dump($page);
//die;
preg_match("/video_id=(\w*)/",$page,$mv);
$v_id = $mv[1];
preg_match("/&t=([\w]*)&/",$page,$tickets);
$ticket = $tickets[1];
$curl = "";
$curl .= $v_id;
$curl .= "&t=";
$curl .= $ticket;
//echo $curl;
$url = "http://www.youtube.com/get_video?video_id=".$curl;
echo $url;
die;
if ($this->debug)
return $url;
output($url) is
http://www.youtube.com/get_video?video_id=nlZJ7RsyC0g&t=
here $t
is null , how do get $ticke
t from youtube url