@@ -34,22 +34,25 @@ def _real_extract(self, url):
34
34
player_key = self ._search_regex (
35
35
r'<param name="playerKey" value="([^"]+)"' , webpage , 'player key' )
36
36
config = self ._download_json (
37
- 'http://client.expotv.com/video/config/%s/%s' % (video_id , player_key ),
38
- video_id ,
39
- note = 'Downloading video configuration' )
37
+ 'http://client.expotv.com/video/config/%s/%s' % (video_id , player_key ),
38
+ video_id , 'Downloading video configuration' )
40
39
41
40
formats = []
42
41
for fcfg in config ['sources' ]:
43
- if fcfg ['type' ] == 'm3u8' :
44
- formats .extend (self ._extract_m3u8_formats (fcfg ['file' ], video_id ))
42
+ media_url = fcfg .get ('file' )
43
+ if not media_url :
44
+ continue
45
+ if fcfg .get ('type' ) == 'm3u8' :
46
+ formats .extend (self ._extract_m3u8_formats (
47
+ media_url , video_id , 'mp4' , entry_protocol = 'm3u8_native' , m3u8_id = 'hls' ))
45
48
else :
46
49
formats .append ({
47
- 'url' : fcfg [ 'file' ] ,
50
+ 'url' : media_url ,
48
51
'height' : int_or_none (fcfg .get ('height' )),
49
52
'format_id' : fcfg .get ('label' ),
50
53
'ext' : self ._search_regex (
51
- r'filename=.*\.([a-z0-9_A-Z]+)&' , fcfg [ 'file' ] ,
52
- 'file extension' , default = None ),
54
+ r'filename=.*\.([a-z0-9_A-Z]+)&' , media_url ,
55
+ 'file extension' , default = None ) or fcfg . get ( 'type' ) ,
53
56
})
54
57
self ._sort_formats (formats )
55
58
0 commit comments