[twitch] Add support for rechat messages (closes #11524)

This commit is contained in:
Sergey M․ 2016-12-24 22:10:54 +07:00
parent d1cd7e0ed9
commit 264e77c406
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -22,6 +22,7 @@
orderedSet,
parse_duration,
parse_iso8601,
update_url_query,
urlencode_postdata,
)
@ -279,6 +280,18 @@ def _real_extract(self, url):
if 't' in query:
info['start_time'] = parse_duration(query['t'][0])
if info.get('timestamp') is not None:
info['subtitles'] = {
'rechat': [{
'url': update_url_query(
'https://rechat.twitch.tv/rechat-messages', {
'video_id': 'v%s' % item_id,
'start': info['timestamp'],
}),
'ext': 'json',
}],
}
return info