mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-25 19:52:11 +00:00
[twitch] Add support for rechat messages (closes #11524)
This commit is contained in:
parent
d1cd7e0ed9
commit
264e77c406
1 changed files with 13 additions and 0 deletions
|
@ -22,6 +22,7 @@ from ..utils import (
|
||||||
orderedSet,
|
orderedSet,
|
||||||
parse_duration,
|
parse_duration,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
|
update_url_query,
|
||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -279,6 +280,18 @@ class TwitchVodIE(TwitchItemBaseIE):
|
||||||
if 't' in query:
|
if 't' in query:
|
||||||
info['start_time'] = parse_duration(query['t'][0])
|
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
|
return info
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue