Exemplo n.º 1
0
 /**
  * Because the normal getChannelByName/Id functions appear to make youtube give 500's,
  * I've got my own wrapper of those functions here.
  * @param $channel string The channel name/id
  * @param $isId boolean Is the first parameter a channel id?
  *
  */
 protected function getChannel($channel, $isId)
 {
     $API_URL = $this->youtube->getApi('channels.list');
     $params = ['part' => 'id,snippet,contentDetails'];
     if ($isId) {
         $params["id"] = $channel;
     } else {
         $params["forUsername"] = $channel;
     }
     $apiData = $this->youtube->api_get($API_URL, $params);
     return $this->youtube->decodeSingle($apiData);
 }