0
美好的一天,
我试图找回我通过我的YouTube频道所拥有的专用播放列表(和相关视频)throught“的OAuth 2.0服务器到服务器“;
但我只看到公共元素!
这是我的PHP代码:谷歌的OAuth 2.0服务器到服务器和YouTube私人播放列表在PHP
$client = new Google_Client();
$client->setAuthConfig(__DIR__ . "/my_service_account.json");
$client->setScopes('https://www.googleapis.com/auth/youtube');
$client->setApplicationName("NameOfMyApp");
$client->refreshTokenWithAssertion();
$token = $client->getAccessToken();
$accessToken = $token['access_token'];
//---------
$YOUTUBE = new Google_Service_YouTube($client);
//---------
$arr_opt = array('channelId' => $MY_CHANNEL_ID);
$arr_playlist = $YOUTUBE->playlists->listPlaylists('snippet,contentDetails',$arr_opt);
var_export($arr_playlist);
我得到一个“正确”的对象, 但如果我的播放列表上的“私人”领域“modelData”设置没有项目:
'modelData' =>
array (
'pageInfo' =>
array (
'totalResults' => 0,
'resultsPerPage' => 5,
),
'items' =>
array (
),
),
我忘了什么?
这是Youtube API的限制吗?
这是通过我的console.developers.google.com服务帐户的错误配置?
谢谢你的帮助!