Php Youtube api V3:分页视频结果、趋势视频和按类别划分的视频
我需要澄清youtube api版本3中的以下内容 1.通过分页获取视频结果 我想通过分页获得结果,但是Php Youtube api V3:分页视频结果、趋势视频和按类别划分的视频,php,video,youtube-data-api,Php,Video,Youtube Data Api,我需要澄清youtube api版本3中的以下内容 1.通过分页获取视频结果 我想通过分页获得结果,但是nextPageToken和prevPageToken在我的响应中为空 这是我的密码 $client = new Google_Client(); $client->setDeveloperKey($DEVELOPER_KEY); $youtube = new Google_Service_YouTube($client); $searchResponse = $y
nextPageToken
和prevPageToken
在我的响应中为空
这是我的密码
$client = new Google_Client();
$client->setDeveloperKey($DEVELOPER_KEY);
$youtube = new Google_Service_YouTube($client);
$searchResponse = $youtube->search->listSearch('id,snippet', array(
'type' => 'video',
'q' => $_GET['q'],
/*'location' => $_GET['location'],
'locationRadius' => $_GET['locationRadius'],*/
'maxResults' => 50,
'order' => 'viewCount'
));
2.获取最受欢迎的视频
如何从我使用参数尝试过的api中获取最流行的视频
'chart'=>'mostPopular'
但它将通过错误未知参数图表
3.按类别获取视频
如何按类别获取视频列表例如:获取
音乐
类别下的视频列表使用listVideos而不是listSearch获取最受欢迎的视频:
$trendingComedy = $youtube->videos->listVideos('snippet', array(
'chart' => 'mostPopular',
'maxResults' => 50,
'regionCode' => 'GB',
'videoCategoryId' => '23'
));
使用listVideos而不是listSearch获取最受欢迎的视频:
$trendingComedy = $youtube->videos->listVideos('snippet', array(
'chart' => 'mostPopular',
'maxResults' => 50,
'regionCode' => 'GB',
'videoCategoryId' => '23'
));
您希望通过使用youtube示例php脚本,或通过响应api的url来获取此信息。您希望通过使用youtube示例php脚本,或通过响应api的url来获取此信息。