php-youtube-api icon indicating copy to clipboard operation
php-youtube-api copied to clipboard

Uncaught Exception: Error 400 'invideoPromotion' ;

Open ahmet700 opened this issue 1 year ago • 0 comments

$channel = $youtube->getChannelById('UC78h1xpnf0nzr24-oZX1qAw');

Fatal error: Uncaught Exception: Error 400 'invideoPromotion' : unknownPart in Youtube.php:530

public function decodeSingle(&$apiData) { $resObj = json_decode($apiData); if (isset($resObj->error)) { $msg = "Error " . $resObj->error->code . " " . $resObj->error->message; if (isset($resObj->error->errors[0])) { $msg .= " : " . $resObj->error->errors[0]->reason; } --------->This error line throw new \Exception($msg,$resObj->error->code); } else { $itemsArray = $resObj->items; if (!is_array($itemsArray) || count($itemsArray) == 0) { return false; } else { return $itemsArray[0]; } } }

ahmet700 avatar Aug 02 '24 15:08 ahmet700