0

クライアント ライブラリ v3 を使用して YouTube に動画をアップロードしようとしています。

v3 ライブラリは実験的なものであり、多くのドキュメントがありません (提供されるサンプルには YouTube は含まれていません)。

oauth 2.0 でユーザーを適切に認証しました。そして、アクセストークンを持っているときは、このコードで試しています。

if ($client->getAccessToken()) {
    $snippet = new Google_VideoSnippet();
    $snippet -> setTitle = "Demo title";
    $snippet -> setDescriptio = "Demo descrition";
    $snippet -> setTags = array("tag1","tag2");
    $snippet -> setMimeType = 'video/quicktime';

    $video = new Google_Video();
    $video -> setSnippet($snippet);

    // Not sure what to do now....

    $_SESSION['access_token'] = $client->getAccessToken();
}

ドキュメントから、

パーツパラメータを指定する必要があります

The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.

The part names that you can include in the parameter value are snippet, contentDetails, player, statistics, status, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.

しかし、私が理解できないpythonの例を除いて、ドキュメントがありません。(例はリンクの下部にあります、私が提供しました)

Zendライブラリへの例/リンクを提供しないでください。これは、私が望まないauth-subを使用しています。oauth 2.0 を使用したい。

4

1 に答える 1