diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 52f2055b5..ddbc04050 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -1806,7 +1806,9 @@ class InfoExtractor(object): def extract_Initialization(source): initialization = source.find(_add_ns('Initialization')) if initialization is not None: - ms_info['initialization_url'] = initialization.attrib['sourceURL'] + initialization_source_url = initialization.attrib.get('sourceURL') + if initialization_source_url is not None: + ms_info['initialization_url'] = initialization_source_url segment_list = element.find(_add_ns('SegmentList')) if segment_list is not None: @@ -1814,7 +1816,9 @@ class InfoExtractor(object): extract_Initialization(segment_list) segment_urls_e = segment_list.findall(_add_ns('SegmentURL')) if segment_urls_e: - ms_info['segment_urls'] = [segment.attrib['media'] for segment in segment_urls_e] + segment_urls = [segment.attrib.get('media') for segment in segment_urls_e] + if segment_urls[0] is not None: + ms_info['segment_urls'] = segment_urls else: segment_template = element.find(_add_ns('SegmentTemplate')) if segment_template is not None: