mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
[youtube] enable all DASH streams
This commit is contained in:
parent
1401f9ad97
commit
f8220f164c
@ -135,7 +135,9 @@ class VideoExtractor():
|
|||||||
# Print DASH streams
|
# Print DASH streams
|
||||||
if self.dash_streams:
|
if self.dash_streams:
|
||||||
print(" [ DASH ] %s" % ('_' * 36))
|
print(" [ DASH ] %s" % ('_' * 36))
|
||||||
for stream in self.dash_streams:
|
itags = sorted(self.dash_streams,
|
||||||
|
key=lambda i: -self.dash_streams[i]['size'])
|
||||||
|
for stream in itags:
|
||||||
self.p_stream(stream)
|
self.p_stream(stream)
|
||||||
# Print all other available streams
|
# Print all other available streams
|
||||||
print(" [ DEFAULT ] %s" % ('_' * 33))
|
print(" [ DEFAULT ] %s" % ('_' * 33))
|
||||||
|
@ -241,7 +241,6 @@ class YouTube(VideoExtractor):
|
|||||||
for rep in aset.getElementsByTagName('Representation'):
|
for rep in aset.getElementsByTagName('Representation'):
|
||||||
w = int(rep.getAttribute('width'))
|
w = int(rep.getAttribute('width'))
|
||||||
h = int(rep.getAttribute('height'))
|
h = int(rep.getAttribute('height'))
|
||||||
if w > 1280:
|
|
||||||
itag = rep.getAttribute('id')
|
itag = rep.getAttribute('id')
|
||||||
burls = rep.getElementsByTagName('BaseURL')
|
burls = rep.getElementsByTagName('BaseURL')
|
||||||
dash_url = burls[0].firstChild.nodeValue
|
dash_url = burls[0].firstChild.nodeValue
|
||||||
@ -259,7 +258,6 @@ class YouTube(VideoExtractor):
|
|||||||
for rep in aset.getElementsByTagName('Representation'):
|
for rep in aset.getElementsByTagName('Representation'):
|
||||||
w = int(rep.getAttribute('width'))
|
w = int(rep.getAttribute('width'))
|
||||||
h = int(rep.getAttribute('height'))
|
h = int(rep.getAttribute('height'))
|
||||||
if w > 1280:
|
|
||||||
itag = rep.getAttribute('id')
|
itag = rep.getAttribute('id')
|
||||||
burls = rep.getElementsByTagName('BaseURL')
|
burls = rep.getElementsByTagName('BaseURL')
|
||||||
dash_url = burls[0].firstChild.nodeValue
|
dash_url = burls[0].firstChild.nodeValue
|
||||||
@ -296,8 +294,7 @@ class YouTube(VideoExtractor):
|
|||||||
dash_webm_a_size = stream['clen']
|
dash_webm_a_size = stream['clen']
|
||||||
for stream in streams: # video
|
for stream in streams: # video
|
||||||
if 'size' in stream:
|
if 'size' in stream:
|
||||||
w = int(r1(r'(\d+)x\d+', stream['size']))
|
if stream['type'].startswith('video/mp4'):
|
||||||
if w > 1280 and 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'])
|
sig = self.__class__.decipher(self.js, stream['s'])
|
||||||
@ -313,7 +310,7 @@ class YouTube(VideoExtractor):
|
|||||||
'src': [dash_url, dash_mp4_a_url],
|
'src': [dash_url, dash_mp4_a_url],
|
||||||
'size': int(dash_size) + int(dash_mp4_a_size)
|
'size': int(dash_size) + int(dash_mp4_a_size)
|
||||||
}
|
}
|
||||||
elif w > 1280 and 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'])
|
sig = self.__class__.decipher(self.js, stream['s'])
|
||||||
|
Loading…
Reference in New Issue
Block a user