By Using curl and json decode. I'm able to get the list of all youtube videos of a user. It works perfectly. Curl return NULL when server is busy. Please suggest me any solution for this problem
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_URL, 'http://gdata.youtube.com/feeds/api/users/USERNAME/uploads?v=2&alt=jsonc&max-results=30);
$output = curl_exec($curl);
curl_close($curl);
$json = json_decode($output,true);
This is the code i'm using to get videos. It is returning NULL when server is Busy.