使用 Youtube API V3 在 JSON 中进行批处理 [英] Batch processing in JSON using Youtube API V3

查看:31
本文介绍了使用 Youtube API V3 在 JSON 中进行批处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 V3 API 将单个视频添加到播放列表,但我无法一次添加多个视频.

I'm able to use the V3 API to add a single video to a playlist, but I'm having trouble adding multiple videos at once.

要使用 API 资源管理器添加单个视频,我的请求如下所示:

To add a single video using the API explorer, my request looks like:

POST https://www.googleapis.com/youtube/v3/playlistItems?             
part=snippet&fields=id%2Cstatus&key={MY_API_KEY}

Content-Type:  application/json
Authorization:  Bearer {MY_TOKEN}
X-JavaScript-User-Agent:  Google APIs Explorer

{
 "snippet": {
  "playlistId": "PLsocvUmhlFZlTIR58nIqSAf2Ue1vQWVJO",
  "resourceId": {
   "playlistId": "PLsocvUmhlFZlTIR58nIqSAf2Ue1vQWVJO",
   "videoId": "7Mbnb_LZwDM",
   "kind": "youtube#video"
  }
 }
}

我基本上想在一个请求中提交多个videoId".我试过 "videoId":["id1","id2","id3"],请求成功但只添加了数组中的第一项.

I basically want to submit multiple "videoIds" in a single request. I've tried "videoId":["id1","id2","id3"], and the request is successful but only adds the first item in the array.

推荐答案

Data API v3,目前不支持同时插入多个 playlistItem.请在 https 中提交功能请求://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Enhancement%20Request) 并在此处让我知道 ID 作为评论.

Data APi v3, currently doesn't support multiple playlistItem inserts at once. Please file a feature request in https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Enhancement%20Request) and let me know the id as a comment here.

但是你可以批量请求https://stackoverflow.com/questions/14310562/how-to-correctly-use-google-api-python-clients-batchhttprequest

这篇关于使用 Youtube API V3 在 JSON 中进行批处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆