Can Not Load Youtube Page To Get Source Code In Php

Rick Estrada <[email protected]>
Newsgroups gmane.comp.web.curl.php
Message-ID <[email protected]>
I was trying to use CURL to load a WEBPAGE from YOUTUBE but it does not grab
any info as it seems to get blocked... I do not have problems using the CURL
on other webpages and even on the youtube frontpage...

here is the link...

http://www.youtube.com/watch?v=TTs-9hNyuB0

any help appreciated on this

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, 'http://www.youtube.com/watch?v=TTs-9hNyuB0'
);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $google_string = curl_exec($ch);
  curl_close($ch);
  $google_string = utf8_encode($google_string);
  print_r($google_string);


-- 
Thanks,
Rick Estrada
Subfighter Mixed Martial Arts
760-908-9472
http://www.subfighter.tv

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.