我正在使用 YouTube Data API v3,有什么方法可以获得播放列表的总持续时间
我想使用 JavaScript 或 TypeScript 获取播放列表的总持续时间以及播放列表中存在的视频总数。
I want to get the total duration of the playlist and also the total number of videos present inside the playlist, using JavaScript or TypeScript.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这只是我这边的更新。
首先,我们将获取该播放列表中的所有视频,然后对于每个视频,我们将发出 50 个视频 ID 的组合请求(每个请求),然后添加持续时间。
这是我的 nextjs API(项目)中的一个示例。
This is an update from my side only.
here first we'll get all the videos inside that playlist then for every video we'll make a combined request of 50 video ids (per request) and then we'll add the duration.
here is an example from my nextjs API (project).