2015-10-05 53 views
1

我使用的PHP文件API库用几乎相同的代码,在这里通过上传我的应用程序的视频更新视频; https://developers.google.com/youtube/v3/code_samples/php#updating_a_video_by_adding_new_tags无法上传或标签

上传的视频正确接收的标题,描述和播放列表,而不是标签。

在所有的任何线索?

编辑: 我想知道它是否与范围有关,如果我已授权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]);

+2

鉴于你没有提供任何有用的信息(例如,实际的代码),我打电话给PEBKAC作为原因... –

+0

我认为这是不必要的,因为它基本上是带有明显变量的示例代码 –

回答

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']); 

产生相同的结果