[common] Extract audio formats in SMIL

Found in http://www.cbc.ca/player/play/2657631896

Closes #5156
pull/9539/merge
Yen Chi Hsuan 9 years ago
parent 043dc9d36f
commit ad96b4c8f5
No known key found for this signature in database
GPG Key ID: 3FDDD575826C5C30

@ -1278,21 +1278,21 @@ class InfoExtractor(object):
m3u8_count = 0 m3u8_count = 0
srcs = [] srcs = []
videos = smil.findall(self._xpath_ns('.//video', namespace)) media = smil.findall(self._xpath_ns('.//video', namespace)) + smil.findall(self._xpath_ns('.//audio', namespace))
for video in videos: for medium in media:
src = video.get('src') src = medium.get('src')
if not src or src in srcs: if not src or src in srcs:
continue continue
srcs.append(src) srcs.append(src)
bitrate = float_or_none(video.get('system-bitrate') or video.get('systemBitrate'), 1000) bitrate = float_or_none(medium.get('system-bitrate') or medium.get('systemBitrate'), 1000)
filesize = int_or_none(video.get('size') or video.get('fileSize')) filesize = int_or_none(medium.get('size') or medium.get('fileSize'))
width = int_or_none(video.get('width')) width = int_or_none(medium.get('width'))
height = int_or_none(video.get('height')) height = int_or_none(medium.get('height'))
proto = video.get('proto') proto = medium.get('proto')
ext = video.get('ext') ext = medium.get('ext')
src_ext = determine_ext(src) src_ext = determine_ext(src)
streamer = video.get('streamer') or base streamer = medium.get('streamer') or base
if proto == 'rtmp' or streamer.startswith('rtmp'): if proto == 'rtmp' or streamer.startswith('rtmp'):
rtmp_count += 1 rtmp_count += 1

Loading…
Cancel
Save