YouTube API: How to specify an API callback after an uploaded video has finished encoding?

こ雲淡風輕ζ 提交于 2021-02-19 04:18:41

问题


I am uploading videos using the YouTube/Gdata API (in python).

After a video has been uploaded via the API, I receive the a response with data about the video (Youtube link, id, etc). However, the video is not publicly available while it is being encoded by YouTube (typically a few minutes).

Can I specify a callback url that YouTube can post to after it finishes processing the video?


回答1:


No.

You need to poll using the video id to and check the 'state' of the video to detect when 'processing' is no longer present.




回答2:


With Youtube's V3 API, you need to do something similar, but slightly different.

GET https://www.googleapis.com/youtube/v3/videos?part=processingDetails&id={VIDEO_ID}&key={YOUR_API_KEY}

Further details here: https://developers.google.com/youtube/v3/docs/videos/list



来源:https://stackoverflow.com/questions/7588239/youtube-api-how-to-specify-an-api-callback-after-an-uploaded-video-has-finished

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!