mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 08:27:07 -05:00 
			
		
		
		
	[twitch:vod] Improve extraction
This commit is contained in:
		@@ -240,14 +240,24 @@ class TwitchVodIE(TwitchItemBaseIE):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def _real_extract(self, url):
 | 
					    def _real_extract(self, url):
 | 
				
			||||||
        item_id = self._match_id(url)
 | 
					        item_id = self._match_id(url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        info = self._download_info(self._ITEM_SHORTCUT, item_id)
 | 
					        info = self._download_info(self._ITEM_SHORTCUT, item_id)
 | 
				
			||||||
        access_token = self._download_json(
 | 
					        access_token = self._download_json(
 | 
				
			||||||
            '%s/api/vods/%s/access_token' % (self._API_BASE, item_id), item_id,
 | 
					           '%s/api/vods/%s/access_token' % (self._API_BASE, item_id), item_id,
 | 
				
			||||||
            'Downloading %s access token' % self._ITEM_TYPE)
 | 
					           'Downloading %s access token' % self._ITEM_TYPE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        formats = self._extract_m3u8_formats(
 | 
					        formats = self._extract_m3u8_formats(
 | 
				
			||||||
            '%s/vod/%s?nauth=%s&nauthsig=%s&allow_source=true'
 | 
					           '%s/vod/%s?%s' % (
 | 
				
			||||||
            % (self._USHER_BASE, item_id, access_token['token'], access_token['sig']),
 | 
					               self._USHER_BASE, item_id,
 | 
				
			||||||
            item_id, 'mp4')
 | 
					               compat_urllib_parse.urlencode({
 | 
				
			||||||
 | 
					                    'allow_source': 'true',
 | 
				
			||||||
 | 
					                    'allow_spectre': 'true',
 | 
				
			||||||
 | 
					                    'player': 'twitchweb',
 | 
				
			||||||
 | 
					                    'nauth': access_token['token'],
 | 
				
			||||||
 | 
					                    'nauthsig': access_token['sig'],
 | 
				
			||||||
 | 
					                })),
 | 
				
			||||||
 | 
					           item_id, 'mp4')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self._prefer_source(formats)
 | 
					        self._prefer_source(formats)
 | 
				
			||||||
        info['formats'] = formats
 | 
					        info['formats'] = formats
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user