python - Youtube Live streaming captions -


i'm developing rtsp stream speech transcriber , test task i'm thinking of trying send subtitles youtube stream. according this link code in python is:

post_fields = datetime.utcnow().strftime('%y-%m-%dt%h:%m:%s.%f')[:-3] + ' region:reg1#cue1' + "<br>" + word + '<br>' headers = {'content-type': 'text/plain'} url = self.youtube_link + '&seq=' + str(self.youtube_seq) r = requests.post(url=url, data=post_fields.encode('utf-8'), headers=headers) self.youtube_seq += 1 

sadly can recieve youtube is:

400 2017-04-05t20:19:58.135 can't parse http post body. 

did managed send captions youtube livestreams via post requests?

you may refer thread. make sure put new line character \n @ end of each message each message consists of time , text according example.

also, noted of live caption requirements. in order add captions live event, need send captions youtube either embedded in video or through supported software can send captions on http posts.


Comments