mirror of
https://github.com/soimort/you-get.git
synced 2025-01-24 05:55:02 +03:00
[youtube] fix more (follow-up to 5dd7b5f
)
This commit is contained in:
parent
aa3c58192a
commit
cf237b4c24
@ -297,8 +297,9 @@ class YouTube(VideoExtractor):
|
|||||||
if stream['type'].startswith('video/mp4'):
|
if stream['type'].startswith('video/mp4'):
|
||||||
mimeType = 'video/mp4'
|
mimeType = 'video/mp4'
|
||||||
dash_url = stream['url']
|
dash_url = stream['url']
|
||||||
sig = self.__class__.decipher(self.js, stream['s'])
|
if 's' in stream:
|
||||||
dash_url += '&signature={}'.format(sig)
|
sig = self.__class__.decipher(self.js, stream['s'])
|
||||||
|
dash_url += '&signature={}'.format(sig)
|
||||||
dash_size = stream['clen']
|
dash_size = stream['clen']
|
||||||
itag = stream['itag']
|
itag = stream['itag']
|
||||||
self.dash_streams[itag] = {
|
self.dash_streams[itag] = {
|
||||||
@ -313,8 +314,9 @@ class YouTube(VideoExtractor):
|
|||||||
elif stream['type'].startswith('video/webm'):
|
elif stream['type'].startswith('video/webm'):
|
||||||
mimeType = 'video/webm'
|
mimeType = 'video/webm'
|
||||||
dash_url = stream['url']
|
dash_url = stream['url']
|
||||||
sig = self.__class__.decipher(self.js, stream['s'])
|
if 's' in stream:
|
||||||
dash_url += '&signature={}'.format(sig)
|
sig = self.__class__.decipher(self.js, stream['s'])
|
||||||
|
dash_url += '&signature={}'.format(sig)
|
||||||
dash_size = stream['clen']
|
dash_size = stream['clen']
|
||||||
itag = stream['itag']
|
itag = stream['itag']
|
||||||
self.dash_streams[itag] = {
|
self.dash_streams[itag] = {
|
||||||
@ -345,10 +347,10 @@ class YouTube(VideoExtractor):
|
|||||||
|
|
||||||
if stream_id in self.streams:
|
if stream_id in self.streams:
|
||||||
src = self.streams[stream_id]['url']
|
src = self.streams[stream_id]['url']
|
||||||
if self.streams[stream_id]['sig'] is not None:
|
if 'sig' in self.streams[stream_id]:
|
||||||
sig = self.streams[stream_id]['sig']
|
sig = self.streams[stream_id]['sig']
|
||||||
src += '&signature={}'.format(sig)
|
src += '&signature={}'.format(sig)
|
||||||
elif self.streams[stream_id]['s'] is not None:
|
elif 's' in self.streams[stream_id]:
|
||||||
if not hasattr(self, 'js'):
|
if not hasattr(self, 'js'):
|
||||||
self.js = get_content(self.html5player)
|
self.js = get_content(self.html5player)
|
||||||
s = self.streams[stream_id]['s']
|
s = self.streams[stream_id]['s']
|
||||||
|
Loading…
Reference in New Issue
Block a user