I'm currently developing an rtsp stream speech transcriber and as a test task I'm thinking of trying to send subtitles for youtube stream. According to this link my 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 all what I can recieve from youtube is:
400
2017-04-05T20:19:58.135
Can't parse HTTP POST body.
Did anyone managed to successfully send captions for youtube livestreams via POST requests?
tag. – Alexey Elesin Apr 09 '17 at 11:40