diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-05-17 15:38:57 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-05-17 15:38:57 +0800 |
commit | 055f0d3d0636e343354a19cd558a3aac3cf31399 (patch) | |
tree | 514e814d481d5627d1370947ae2063bc72004807 /youtube_dl/extractor/amp.py | |
parent | cdd94c2eae6c6f0a627d457c3a73894a62eb86c5 (diff) |
[abcnews] Added a new extractor (closes #3992)
Related: #6108, #8664, #9459
Diffstat (limited to 'youtube_dl/extractor/amp.py')
-rw-r--r-- | youtube_dl/extractor/amp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/extractor/amp.py b/youtube_dl/extractor/amp.py index 138fa0808..8545681be 100644 --- a/youtube_dl/extractor/amp.py +++ b/youtube_dl/extractor/amp.py @@ -52,7 +52,7 @@ class AMPIE(InfoExtractor): for media_data in media_content: media = media_data['@attributes'] media_type = media['type'] - if media_type == 'video/f4m': + if media_type in ('video/f4m', 'application/f4m+xml'): formats.extend(self._extract_f4m_formats( media['url'] + '?hdcore=3.4.0&plugin=aasp-3.4.0.132.124', video_id, f4m_id='hds', fatal=False)) @@ -61,7 +61,7 @@ class AMPIE(InfoExtractor): media['url'], video_id, 'mp4', m3u8_id='hls', fatal=False)) else: formats.append({ - 'format_id': media_data['media-category']['@attributes']['label'], + 'format_id': media_data.get('media-category', {}).get('@attributes', {}).get('label'), 'url': media['url'], 'tbr': int_or_none(media.get('bitrate')), 'filesize': int_or_none(media.get('fileSize')), |