X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/5920ef2b4969021b7f83d154b325036d9b598877..04c6e7e9539d48169931f1911a39ed223d44cf2b:/youtube_dl/extractor/vzaar.py diff --git a/youtube_dl/extractor/vzaar.py b/youtube_dl/extractor/vzaar.py index 6000671..b7d02fc 100644 --- a/youtube_dl/extractor/vzaar.py +++ b/youtube_dl/extractor/vzaar.py @@ -32,6 +32,22 @@ class VzaarIE(InfoExtractor): 'ext': 'mp3', 'title': 'MP3', }, + }, { + # hlsAes = true + 'url': 'https://view.vzaar.com/11379930/player', + 'info_dict': { + 'id': '11379930', + 'ext': 'mp4', + 'title': 'Videoaula', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + }, { + # with null videoTitle + 'url': 'https://view.vzaar.com/20313539/download', + 'only_matching': True, }] @staticmethod @@ -45,7 +61,7 @@ class VzaarIE(InfoExtractor): video_data = self._download_json( 'http://view.vzaar.com/v2/%s/video' % video_id, video_id) - title = video_data['videoTitle'] + title = video_data.get('videoTitle') or video_id formats = [] @@ -54,6 +70,7 @@ class VzaarIE(InfoExtractor): f = { 'url': source_url, 'format_id': 'http', + 'preference': 1, } if 'audio' in source_url: f.update({ @@ -71,13 +88,17 @@ class VzaarIE(InfoExtractor): video_guid = video_data.get('guid') usp = video_data.get('usp') - if isinstance(video_guid, compat_str) and isinstance(usp, dict): - m3u8_url = ('http://fable.vzaar.com/v4/usp/%s/%s.ism/.m3u8?' - % (video_guid, video_id)) + '&'.join( - '%s=%s' % (k, v) for k, v in usp.items()) - formats.extend(self._extract_m3u8_formats( - m3u8_url, video_id, 'mp4', entry_protocol='m3u8_native', - m3u8_id='hls', fatal=False)) + if video_data.get('uspEnabled') and isinstance(video_guid, compat_str) and isinstance(usp, dict): + hls_aes = video_data.get('hlsAes') + qs = '&'.join('%s=%s' % (k, v) for k, v in usp.items()) + url_templ = 'http://%%s.vzaar.com/v5/usp%s/%s/%s.ism%%s?' % ('aes' if hls_aes else '', video_guid, video_id) + m3u8_formats = self._extract_m3u8_formats( + url_templ % ('fable', '/.m3u8') + qs, video_id, 'mp4', 'm3u8_native', + m3u8_id='hls', fatal=False) + if hls_aes: + for f in m3u8_formats: + f['_decryption_key_url'] = url_templ % ('goose', '') + qs + formats.extend(m3u8_formats) self._sort_formats(formats)