diff options
author | Sergey M․ <dstftw@gmail.com> | 2017-07-09 17:55:40 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2017-07-09 17:55:40 +0700 |
commit | 58179eb7d96ebef26a0083e80a2022fab4ca1558 (patch) | |
tree | bbf823476ceabab2ddb67d6e6e1f78b2f7898238 /youtube_dl/extractor/abc.py | |
parent | 485cb375766df8f2ef79b7fe2915ead4ef61a01e (diff) |
[abc.net.au:iview] Extract more formats (closes #13492, closes #13489)
Diffstat (limited to 'youtube_dl/extractor/abc.py')
-rw-r--r-- | youtube_dl/extractor/abc.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/youtube_dl/extractor/abc.py b/youtube_dl/extractor/abc.py index 0247cabf9..60f753b95 100644 --- a/youtube_dl/extractor/abc.py +++ b/youtube_dl/extractor/abc.py @@ -3,11 +3,13 @@ from __future__ import unicode_literals import re from .common import InfoExtractor +from ..compat import compat_str from ..utils import ( ExtractorError, js_to_json, int_or_none, parse_iso8601, + try_get, ) @@ -124,7 +126,20 @@ class ABCIViewIE(InfoExtractor): title = video_params.get('title') or video_params['seriesTitle'] stream = next(s for s in video_params['playlist'] if s.get('type') == 'program') - formats = self._extract_akamai_formats(stream['hds-unmetered'], video_id) + format_urls = [ + try_get(stream, lambda x: x['hds-unmetered'], compat_str)] + + # May have higher quality video + sd_url = try_get( + stream, lambda x: x['streams']['hds']['sd'], compat_str) + if sd_url: + format_urls.append(sd_url.replace('metered', 'um')) + + formats = [] + for format_url in format_urls: + if format_url: + formats.extend( + self._extract_akamai_formats(format_url, video_id)) self._sort_formats(formats) subtitles = {} |