【问题标题】:Can you set a YouTube video's license to CreativeCommons via the PHP 3.0 API?您可以通过 PHP 3.0 API 将 YouTube 视频的许可证设置为 CreativeCommons 吗?
【发布时间】:2013-04-10 00:38:21
【问题描述】:

你应该能够通过这样的方式做到这一点:

$snippet = new Google_VideoSnippet();
$snippet->setTitle("some title");
$snippet->setDescription("some description);
...

$status = new Google_VideoStatus();
$status->setPrivacyStatus("public");
$status->setLicense("creativeCommon");

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

等等。是的,您会认为 setLicense 的值是“creativeCommons”,但它不是 (https://developers.google.com/youtube/v3/docs/videos#resource)。使用“creativeCommons”或“youtube”和“creativeCommon”以外的任何内容都会导致“(500) Bad Request”响应。

但真正的问题是,无论如何,对我来说,一旦视频上传到 YouTube(它正在这样做),无论我指定“youtube”还是“creativeCommon”,我都会获得 YouTube 许可证。那么:这应该可行吗/我做错了吗/有什么想法吗?

【问题讨论】:

  • 我注意到了同样的问题。 setPrivacyStatus() 似乎工作正常,但 setLicense()、setEmbeddable() 和 setPublicStatsViewable() 不能。 API 表明在使用 part = "status" 时所有 4 个都应该可用。似乎在任何地方都没有对此进行任何进一步的讨论或解释。有谁知道让它工作的诀窍吗?

标签: php youtube-api google-api-php-client


【解决方案1】:

不确定这是否对任何人有帮助,但(几年后)似乎可以使用 api 的 javascript 版本(v3)将 licencetype 设置为 creativeCommon。

UploadVideo.prototype.uploadFile = function(file) {
    var metadata = {
        status: {
            privacyStatus: $('#privacy-status option:selected').text(),
            license: "creativeCommon"
        }
    };

【讨论】:

    猜你喜欢
    • 2022-06-17
    • 2016-06-22
    • 2013-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-04
    • 2012-09-12
    • 2012-01-17
    相关资源
    最近更新 更多