mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
[youtube] fix KeyError: 'url'
on some videos
This commit is contained in:
parent
81ba2bc65c
commit
c81cfb58db
@ -335,9 +335,9 @@ class YouTube(VideoExtractor):
|
|||||||
'mime': stream['mimeType'].split(';')[0],
|
'mime': stream['mimeType'].split(';')[0],
|
||||||
'container': mime_to_container(stream['mimeType'].split(';')[0]),
|
'container': mime_to_container(stream['mimeType'].split(';')[0]),
|
||||||
}
|
}
|
||||||
if 'cipher' in stream:
|
if 'signatureCipher' in stream:
|
||||||
self.streams[stream_itag].update(dict([(_.split('=')[0], parse.unquote(_.split('=')[1]))
|
self.streams[stream_itag].update(dict([(_.split('=')[0], parse.unquote(_.split('=')[1]))
|
||||||
for _ in stream['cipher'].split('&')]))
|
for _ in stream['signatureCipher'].split('&')]))
|
||||||
|
|
||||||
# Prepare caption tracks
|
# Prepare caption tracks
|
||||||
try:
|
try:
|
||||||
@ -481,10 +481,10 @@ class YouTube(VideoExtractor):
|
|||||||
del stream['contentLength']
|
del stream['contentLength']
|
||||||
del stream['initRange']
|
del stream['initRange']
|
||||||
del stream['indexRange']
|
del stream['indexRange']
|
||||||
if 'cipher' in stream:
|
if 'signatureCipher' in stream:
|
||||||
stream.update(dict([(_.split('=')[0], parse.unquote(_.split('=')[1]))
|
stream.update(dict([(_.split('=')[0], parse.unquote(_.split('=')[1]))
|
||||||
for _ in stream['cipher'].split('&')]))
|
for _ in stream['signatureCipher'].split('&')]))
|
||||||
del stream['cipher']
|
del stream['signatureCipher']
|
||||||
|
|
||||||
for stream in streams: # get over speed limiting
|
for stream in streams: # get over speed limiting
|
||||||
stream['url'] += '&ratebypass=yes'
|
stream['url'] += '&ratebypass=yes'
|
||||||
|
Loading…
Reference in New Issue
Block a user