YouTube API v3 批处理

2022-01-19 00:00:00 youtube-api java

YouTube API v3 是否支持批处理?我已经使用普通的单个请求编写了我的代码,但它需要永远执行,因为它大约有 40000 个请求.

does YouTube API v3 support batch processing? I've wrote my code using normal individual requests, but it takes forever to execute since it's about 40000 requests .

推荐答案

是的,在 v3 中支持批处理,但在 v2 中不支持.

Yes, batch processing is supported in v3 but not like in v2.

https://developers.google.com/youtube/v3/指南/实施/弃用#Batch_Processing

v3 API 支持 v2 API 支持的批处理用例之一.v3 API 的 channels.list、channelSections.list、guideCategories.list、playlistItems.list、playlists.list、subscriptions.list、videoCategories.list 和 videos.list 方法都支持 id 参数,可用于指定以逗号分隔的 ID 列表(视频 ID、频道 ID 等).使用这些方法,您可以检索多个资源的列表一个请求."

"The v3 API supports one of the batch processing use cases that the v2 API had supported. The v3 API's channels.list, channelSections.list, guideCategories.list, playlistItems.list, playlists.list, subscriptions.list, videoCategories.list, and videos.list methods all support an id parameter, which can be used to specify a comma-delimited list of IDs (video IDs, channel IDs, etc.). Using those methods, you can retrieve a list of multiple resources with a single request."

相关文章