[youtube] fix VEVO when no 's' field presents

This commit is contained in:
Mort Yao 2015-10-21 20:53:14 +02:00
parent 901cbaaf73
commit 5dd7b5fd10
2 changed files with 7 additions and 5 deletions

View File

@ -72,7 +72,7 @@ SITES = {
'vk' : 'vk',
'xiami' : 'xiami',
'yinyuetai' : 'yinyuetai',
'miaopai': 'yixia_miaopai',
'miaopai' : 'yixia_miaopai',
'youku' : 'youku',
'youtu' : 'youtube',
'youtube' : 'youtube',

View File

@ -276,13 +276,15 @@ class YouTube(VideoExtractor):
for stream in streams: # audio
if stream['type'].startswith('audio/mp4'):
dash_mp4_a_url = stream['url']
sig = self.__class__.decipher(self.js, stream['s'])
dash_mp4_a_url += '&signature={}'.format(sig)
if 's' in stream:
sig = self.__class__.decipher(self.js, stream['s'])
dash_mp4_a_url += '&signature={}'.format(sig)
dash_mp4_a_size = stream['clen']
elif stream['type'].startswith('audio/webm'):
dash_webm_a_url = stream['url']
sig = self.__class__.decipher(self.js, stream['s'])
dash_webm_a_url += '&signature={}'.format(sig)
if 's' in stream:
sig = self.__class__.decipher(self.js, stream['s'])
dash_webm_a_url += '&signature={}'.format(sig)
dash_webm_a_size = stream['clen']
for stream in streams: # video
if 'size' in stream: