2014-10-01 81 views
1

我可以上傳視頻,使用YouTube數據API使用下面的示例代碼我的YouTube帳戶:YouTube數據API - 如何獲取我剛剛上傳的視頻的網址?

https://developers.google.com/youtube/v3/code_samples/java#update_a_video

2個查詢:

一)我如何才能找到用戶需要的URL上傳完成後使用以訪問視頻?

b)我看過一些舊帖子,指出只有YouTube「Premium Partners」可以通過其中一個API設置獲利設置。但是,當我查看當前的YouTube會員類型時,只有:「所有創建者」,「已驗證頻道」和「合作伙伴」(https://www.youtube.com/yt/creators/creator-benefits.html)。有沒有辦法設置貨幣化設置以及誰可以使用?

我也看到有人試圖使用YouTube帳戶的默認獲利設置,但這似乎不起作用(How to enable monetization for videos uploaded with YouTube Data API v3?)。

謝謝!

回答

-1

您可以在API返回的Video實例對象中找到新視頻的ID,並從那裏獲取URL。在代碼中看下面這些行:

//調用API並上傳視頻。 視頻returnedVideo = videoInsert.execute();

 // Print data about the newly inserted video from the API response. 
     System.out.println("\n================== Returned Video ==================\n"); 
     System.out.println(" - Id: " + returnedVideo.getId()); 

希望這會有所幫助。

massimo

相關問題