title: unable to download youtube video using phptube class
body: <p>i m using phptube class for downloading you tube video.</p>
  
  <p><a href="http://www.sajithmr.me/download-youtube-videos-using-php-code/" rel="nofollow noreferrer">from this site</a></p>
  
  <p>In code i paste youtube url on a input box but there is errors below.</p>
  
  <pre><code>Warning: file_get_contents(http://www.youtube.com/get_video?video_id=&amp;t=)
  [function.file-get-contents]: failed to open stream: HTTP request failed! 
  HTTP/1.0 404 Not Found
  </code></pre>
  
  <p>and </p>
  
  <pre><code>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
  </code></pre>
  
  <p>please tell me where is problem???</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>here is main code</p>
  
  <pre><code>$url = "http://www.youtube.com/watch?v=".$video_id;
              //where $video_id=nlZJ7RsyC0g
      $this-&gt;req =&amp; new HTTP_Request($url);
      //echo "&lt;pre&gt;";
      //print_r($this-&gt;req);
      //echo "&lt;/pre&gt;";
      //die;
      $response = $this-&gt;req-&gt;sendRequest();
      //echo $response; die;
      if (PEAR::isError($response)) {
          //echo "inside if";
          $response-&gt;getMessage()."\n";
      } else {    
          //echo "inside else";
          $page = $this-&gt;req-&gt;getResponseBody();  
          //print_r($page);
          //var_dump($page);
          //die;
          preg_match("/video_id=(\w*)/",$page,$mv);
  
          $v_id = $mv[1]; 
  
          preg_match("/&amp;t=([\w]*)&amp;/",$page,$tickets);
          $ticket = $tickets[1];
  
          $curl = "";
          $curl .= $v_id;
          $curl .= "&amp;t=";
          $curl .= $ticket;
          //echo $curl;
          $url = "http://www.youtube.com/get_video?video_id=".$curl;
          echo $url;
          die;
          if ($this-&gt;debug)
          return $url;    
  </code></pre>
  
  <p>output($url) is
  <code>http://www.youtube.com/get_video?video_id=nlZJ7RsyC0g&amp;t=</code></p>
  
  <p>here <code>$t</code> is null , how do get <code>$ticke</code>t from youtube url</p>