diff options
author | Remita Amine <remitamine@gmail.com> | 2018-12-10 14:59:57 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2018-12-10 15:02:54 +0100 |
commit | 13e17cd28e7f9e3bd8be4fa7b073a5cb96f5959f (patch) | |
tree | a348b156cbf69c3f30b3ccabe9c4f68005830d48 /youtube_dl/extractor/uol.py | |
parent | 102a4e54c5c0819233773cc15398bc901a218f4c (diff) |
[uol] fix format url extraction(closes 18480)
Diffstat (limited to 'youtube_dl/extractor/uol.py')
-rw-r--r-- | youtube_dl/extractor/uol.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/youtube_dl/extractor/uol.py b/youtube_dl/extractor/uol.py index e67083004..08f0c072e 100644 --- a/youtube_dl/extractor/uol.py +++ b/youtube_dl/extractor/uol.py @@ -61,7 +61,7 @@ class UOLIE(InfoExtractor): 'height': 360, }, '5': { - 'width': 1080, + 'width': 1280, 'height': 720, }, '6': { @@ -80,6 +80,10 @@ class UOLIE(InfoExtractor): 'width': 568, 'height': 320, }, + '11': { + 'width': 640, + 'height': 360, + } } def _real_extract(self, url): @@ -111,19 +115,31 @@ class UOLIE(InfoExtractor): 'ver': video_data.get('numRevision', 2), 'r': 'http://mais.uol.com.br', } + for k in ('token', 'sign'): + v = video_data.get(k) + if v: + query[k] = v + formats = [] for f in video_data.get('formats', []): f_url = f.get('url') or f.get('secureUrl') if not f_url: continue + f_url = update_url_query(f_url, query) format_id = str_or_none(f.get('id')) + if format_id == '10': + formats.extend(self._extract_m3u8_formats( + f_url, video_id, 'mp4', 'm3u8_native', + m3u8_id='hls', fatal=False)) + continue fmt = { 'format_id': format_id, - 'url': update_url_query(f_url, query), + 'url': f_url, + 'source_preference': 1, } fmt.update(self._FORMATS.get(format_id, {})) formats.append(fmt) - self._sort_formats(formats) + self._sort_formats(formats, ('height', 'width', 'source_preference', 'tbr', 'ext')) tags = [] for tag in video_data.get('tags', []): |