首页 文章

无法使用代码上传或更新视频

提问于
浏览
1

我使用文档化的PHP API库通过我的应用程序上传视频,其代码与此处的代码完全相同; https://developers.google.com/youtube/v3/code_samples/php#updating_a_video_by_adding_new_tags .

上传的视频正确接收 Headers ,说明和播放列表,但不接收标签 .

有任何线索吗?

编辑:我'm wondering if it has anything to do with scope, does it matter if i'已授权 https://www.googleapis.com/auth/youtubehttps://www.googleapis.com/auth/youtube.upload

这个问题:Youtube Google API V3: List Videos not returning video tags得到一个建议"onBehalfOfContentOwner"参数的答案,但是,当我尝试使用该参数上传时,我得到 "HTTP 403: youtube.common, Access forbidden. The request may not be properly authorized"$insertRequest = $youtube->videos->insert('status,snippet', $video, ['onBehalfOfContentOwner' => true]);

1 回答

  • 1

    我发现了问题,不知道为什么它会成为一个问题;当设置标签我正在做一个数组过滤器,当我删除它作为一个绝望的测试或“我是盲目和使用错误的array_ *函数”,标签来了

    如此变化

    $snippet->setTags(array_filter($medium['properties']['keywords']));
    

    $snippet->setTags($medium['properties']['keywords']);
    

    做了诀窍......我可以通过重新添加array_filter重现问题,我确保检查所以它实际上不是空的,

    var_dump(array_filter($medium['properties']['keywords']), $medium['properties']['keywords']);
    

    产生了相同的结果

相关问题