mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	[expotv] parse m3u8 manifest
This commit is contained in:
		@@ -33,20 +33,24 @@ class ExpoTVIE(InfoExtractor):
 | 
				
			|||||||
        webpage = self._download_webpage(url, video_id)
 | 
					        webpage = self._download_webpage(url, video_id)
 | 
				
			||||||
        player_key = self._search_regex(
 | 
					        player_key = self._search_regex(
 | 
				
			||||||
            r'<param name="playerKey" value="([^"]+)"', webpage, 'player key')
 | 
					            r'<param name="playerKey" value="([^"]+)"', webpage, 'player key')
 | 
				
			||||||
        config_url = 'http://client.expotv.com/video/config/%s/%s' % (
 | 
					 | 
				
			||||||
            video_id, player_key)
 | 
					 | 
				
			||||||
        config = self._download_json(
 | 
					        config = self._download_json(
 | 
				
			||||||
            config_url, video_id,
 | 
					                'http://client.expotv.com/video/config/%s/%s' % (video_id, player_key),
 | 
				
			||||||
            note='Downloading video configuration')
 | 
					                video_id,
 | 
				
			||||||
 | 
					                note='Downloading video configuration')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        formats = [{
 | 
					        formats = []
 | 
				
			||||||
            'url': fcfg['file'],
 | 
					        for fcfg in config['sources']:
 | 
				
			||||||
            'height': int_or_none(fcfg.get('height')),
 | 
					            if fcfg['type'] == 'm3u8':
 | 
				
			||||||
            'format_note': fcfg.get('label'),
 | 
					                formats.extend(self._extract_m3u8_formats(fcfg['file'], video_id))
 | 
				
			||||||
            'ext': self._search_regex(
 | 
					            else:
 | 
				
			||||||
                r'filename=.*\.([a-z0-9_A-Z]+)&', fcfg['file'],
 | 
					                formats.append({
 | 
				
			||||||
                'file extension', default=None),
 | 
					                    'url': fcfg['file'],
 | 
				
			||||||
        } for fcfg in config['sources']]
 | 
					                    'height': int_or_none(fcfg.get('height')),
 | 
				
			||||||
 | 
					                    'format_id': fcfg.get('label'),
 | 
				
			||||||
 | 
					                    'ext': self._search_regex(
 | 
				
			||||||
 | 
					                        r'filename=.*\.([a-z0-9_A-Z]+)&', fcfg['file'],
 | 
				
			||||||
 | 
					                        'file extension', default=None),
 | 
				
			||||||
 | 
					                })
 | 
				
			||||||
        self._sort_formats(formats)
 | 
					        self._sort_formats(formats)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        title = self._og_search_title(webpage)
 | 
					        title = self._og_search_title(webpage)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user