diff options
| author | Sergey M․ <dstftw@gmail.com> | 2016-12-24 22:10:54 +0700 | 
|---|---|---|
| committer | Sergey M․ <dstftw@gmail.com> | 2016-12-24 22:10:54 +0700 | 
| commit | 264e77c406a3b14f15aafcd036524cb6fe86aa20 (patch) | |
| tree | a5bc25fd7b470f22b5f4a9a31b11e5eafacd0a97 /youtube_dl/extractor/twitch.py | |
| parent | d1cd7e0ed9a562dbee6dfcb3601fdecc4158640b (diff) | |
[twitch] Add support for rechat messages (closes #11524)
Diffstat (limited to 'youtube_dl/extractor/twitch.py')
| -rw-r--r-- | youtube_dl/extractor/twitch.py | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py index 8de8ec65b..bbf071da3 100644 --- a/youtube_dl/extractor/twitch.py +++ b/youtube_dl/extractor/twitch.py @@ -22,6 +22,7 @@ from ..utils import (      orderedSet,      parse_duration,      parse_iso8601, +    update_url_query,      urlencode_postdata,  ) @@ -279,6 +280,18 @@ class TwitchVodIE(TwitchItemBaseIE):          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 | 
