2015-10-05 40 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']); 

產生相同的結果