他们在视频资源的文档中说,snippet属性包含channelId,title,description,tags和categoryId属性。我的代码吹了
$main=ngegrab('https://www.googleapis.com/youtube/v3/videos?part=snippet&contentDetails&statistics&id=0W55Oed_Uic&key=AIzaSyD7o2nlYk-a57KEXHfW4QNZ1Z6nhE-4x0g');
$sub=json_decode($main);
foreach ($sub->items as $item){
$name = $item->snippet->title;
$des = $item->snippet->description;
$vid = $item->id->videoId;
当我尝试使用echo来打印$ name给出视频名称但$ des没有给出描述而$ vid没有给出视频ID