0
おはよう、
私のYouTubeチャンネルが所有するプライベートプレイリスト(および関連する動画)は、「サーバー間のOAuth 2.0」 ";
でも、公開されている要素のみが表示されます。
これは私のPHPコードです:Google OAuth 2.0 for PHPとサーバーのYoutubeプライベートプレイリスト
$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でサービスアカウントの設定が正しくありませんか?
ありがとうございました!