mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 07:17:07 -05:00 
			
		
		
		
	[twitch] Add support for rechat messages (closes #11524)
This commit is contained in:
		@@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user