batch = BatchHttpRequest()
requests = []
for language, caption in caption_files.items():
request = youtube.captions().insert(
part='snippet',
body={
'snippet': {
'videoId': video_id,
'language': caption.get("code"),
'name': language,
'isDraft': False
}
},
media_body=caption.get("path")
)
batch.add(request, callback=insert_caption, request_id=video_id)
batch.execute()
I tried with batch = youtube.new_batch_http_request() also. Both are not working. I am getting errors.
Can anyone help me resolve these issues? Are there classes and functions available in Google's Python modules related to batch processing that support inserting/updating captions for YouTube videos?