Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3759

How to upload caption to Youtube using rest API

$
0
0

I am struggling while trying to upload programmatically Youtube captions, following the official documentation: https://developers.google.com/youtube/v3/docs/captions/insert.

I tried many things with postman:1/ pass the snippet in the body: caption file is missing

2/ use form-data and try to add both the file and the snippet data: data are not found.(I tried multiple ways to try to pass the snippet info together with the caption file. ex: snippet.language, snippet["language"], snippet and pass a stringified json...)

Using FormDataUsing Raw Json

Example of request Using Raw Json

curl --location 'https://www.googleapis.com/youtube/v3/captions/' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer xxx.yyy.zzz' \--data '{"snippet": {"language": "fr","name": "Spanish captions","videoId": "flz-udcavwE","isDraft": false  }}

Example of request using FormData

curl --location 'https://www.googleapis.com/youtube/v3/captions/?part=snippet' \--header 'Authorization: Bearer xxx.yyy.zzz' \--form 'caption=@"tnGz3GV3E/captions.sbv"' \--form 'snippet="{\"snippet\":{\"language\":\"fr\",\"name\":\"fr\"&\"videoId\":\"flz-udcavwE\"}}"

Please help to construct properly that call!


Viewing all articles
Browse latest Browse all 3759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>