Error in Getting Youtube Video Title, Description and thumbnail

Posted by Muhammad Ayyaz Zafar on Stack Overflow See other posts from Stack Overflow or by Muhammad Ayyaz Zafar
Published on 2012-05-11T12:51:52Z Indexed on 2012/12/09 11:09 UTC
Read the original article Hit count: 264

Filed under:
|
|

I was getting youtube title and youtube description form the same code but now its not working I am getting following error:

Warning: DOMDocument::load() [domdocument.load]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/colorsfo/public_html/zaroorat/admin/pages/addSongProcess.php on line 16

Warning: DOMDocument::load(http://gdata.youtube.com/feeds/api/videos/Y7G-tYRzwYY) [domdocument.load]: failed to open stream: no suitable wrapper could be found in /home/colorsfo/public_html/zaroorat/admin/pages/addSongProcess.php on line 16

Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/videos/Y7G-tYRzwYY" in /home/colorsfo/public_html/zaroorat/admin/pages/addSongProcess.php on line 16

.................................... Following Coding is used to get Youtube Video Data:

$url = "http://gdata.youtube.com/feeds/api/videos/".$embedCodeParts2[0]; $doc = new DOMDocument; @$doc->load($url); $title = $doc->getElementsByTagName("title")->item(0)->nodeValue; $videoDescription = $doc->getElementsByTagName("description")->item(0)->nodeValue;

It was working before (This coding is working fine in Local server but on internet its not working) but now its not working. Please guide me how to fix this error. Thanks for your time.

© Stack Overflow or respective owner

Related posts about php

Related posts about youtube