替代 https://gdata.youtube.com/feeds/api/videos/<video_id>?v=2

Alternative for https://gdata.youtube.com/feeds/api/videos/<video_id>?v=2

最近我注意到我在我的项目中使用的 Youtube API 不再可用,例如

https://gdata.youtube.com/feeds/api/videos/dLEk9yiXVQs?v=2

returns HTTP 410 响应代码,这意味着所请求的资源不再可用并且不会再次可用。

我应该改用什么?

如果我没有正确理解你的问题,那么从现在开始你应该使用 https://www.googleapis.com/youtube/v3/videos?id=<video_id>&key=<YOUR_API_KEY>&part=snippet

Google shutdown the old API effective April 20th, 2015.

看看最新的 v3 API getting started.

您可以在 = 之后将此 link 与您的 Youtube 频道 ID 一起使用,它应该可以工作。

https://www.youtube.com/feeds/videos.xml?channel_id= 您的 YouTube 频道 ID 号