mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-10 15:20:01 +08:00
Merge pull request #184 from ytdl-org/master
[pull] master from ytdl-org:master
This commit is contained in:
commit
05444acf09
@ -64,7 +64,7 @@ class HlsFD(FragmentFD):
|
|||||||
s = urlh.read().decode('utf-8', 'ignore')
|
s = urlh.read().decode('utf-8', 'ignore')
|
||||||
|
|
||||||
if not self.can_download(s, info_dict):
|
if not self.can_download(s, info_dict):
|
||||||
if info_dict.get('extra_param_to_segment_url'):
|
if info_dict.get('extra_param_to_segment_url') or info_dict.get('_decryption_key_url'):
|
||||||
self.report_error('pycrypto not found. Please install it.')
|
self.report_error('pycrypto not found. Please install it.')
|
||||||
return False
|
return False
|
||||||
self.report_warning(
|
self.report_warning(
|
||||||
@ -169,7 +169,7 @@ class HlsFD(FragmentFD):
|
|||||||
if decrypt_info['METHOD'] == 'AES-128':
|
if decrypt_info['METHOD'] == 'AES-128':
|
||||||
iv = decrypt_info.get('IV') or compat_struct_pack('>8xq', media_sequence)
|
iv = decrypt_info.get('IV') or compat_struct_pack('>8xq', media_sequence)
|
||||||
decrypt_info['KEY'] = decrypt_info.get('KEY') or self.ydl.urlopen(
|
decrypt_info['KEY'] = decrypt_info.get('KEY') or self.ydl.urlopen(
|
||||||
self._prepare_url(info_dict, decrypt_info['URI'])).read()
|
self._prepare_url(info_dict, info_dict.get('_decryption_key_url') or decrypt_info['URI'])).read()
|
||||||
frag_content = AES.new(
|
frag_content = AES.new(
|
||||||
decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(frag_content)
|
decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(frag_content)
|
||||||
self._append_fragment(ctx, frag_content)
|
self._append_fragment(ctx, frag_content)
|
||||||
|
@ -32,6 +32,18 @@ class VzaarIE(InfoExtractor):
|
|||||||
'ext': 'mp3',
|
'ext': 'mp3',
|
||||||
'title': '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
|
# with null videoTitle
|
||||||
'url': 'https://view.vzaar.com/20313539/download',
|
'url': 'https://view.vzaar.com/20313539/download',
|
||||||
@ -58,6 +70,7 @@ class VzaarIE(InfoExtractor):
|
|||||||
f = {
|
f = {
|
||||||
'url': source_url,
|
'url': source_url,
|
||||||
'format_id': 'http',
|
'format_id': 'http',
|
||||||
|
'preference': 1,
|
||||||
}
|
}
|
||||||
if 'audio' in source_url:
|
if 'audio' in source_url:
|
||||||
f.update({
|
f.update({
|
||||||
@ -75,13 +88,17 @@ class VzaarIE(InfoExtractor):
|
|||||||
|
|
||||||
video_guid = video_data.get('guid')
|
video_guid = video_data.get('guid')
|
||||||
usp = video_data.get('usp')
|
usp = video_data.get('usp')
|
||||||
if isinstance(video_guid, compat_str) and isinstance(usp, dict):
|
if video_data.get('uspEnabled') and isinstance(video_guid, compat_str) and isinstance(usp, dict):
|
||||||
m3u8_url = ('http://fable.vzaar.com/v4/usp/%s/%s.ism/.m3u8?'
|
hls_aes = video_data.get('hlsAes')
|
||||||
% (video_guid, video_id)) + '&'.join(
|
qs = '&'.join('%s=%s' % (k, v) for k, v in usp.items())
|
||||||
'%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)
|
||||||
formats.extend(self._extract_m3u8_formats(
|
m3u8_formats = self._extract_m3u8_formats(
|
||||||
m3u8_url, video_id, 'mp4', entry_protocol='m3u8_native',
|
url_templ % ('fable', '/.m3u8') + qs, video_id, 'mp4', 'm3u8_native',
|
||||||
m3u8_id='hls', fatal=False))
|
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)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user