handle missing storyboard
Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
parent
63c92e0c4e
commit
a5ef801c07
@ -117,8 +117,8 @@
|
||||
},
|
||||
},
|
||||
previewThumbnails: {
|
||||
enabled: true,
|
||||
src: [storyboard_url],
|
||||
enabled: storyboard_url != null,
|
||||
src: [storyboard_url],
|
||||
},
|
||||
settings: ['captions', 'quality', 'speed', 'loop'],
|
||||
});
|
||||
|
@ -789,7 +789,8 @@ def get_watch_page(video_id=None):
|
||||
video_url = util.URL_ORIGIN + '/watch?v=' + video_id,
|
||||
video_id = video_id,
|
||||
storyboard_url = (util.URL_ORIGIN + '/ytl-api/storyboard.vtt?' +
|
||||
urlencode([('spec_url', info['storyboard_spec_url'])])),
|
||||
urlencode([('spec_url', info['storyboard_spec_url'])])
|
||||
if info['storyboard_spec_url'] else None),
|
||||
|
||||
js_data = {
|
||||
'video_id': info['id'],
|
||||
|
@ -650,7 +650,8 @@ def extract_watch_info(polymer_json):
|
||||
|
||||
# other stuff
|
||||
info['author_url'] = 'https://www.youtube.com/channel/' + info['author_id'] if info['author_id'] else None
|
||||
info['storyboard_spec_url'] = player_response['storyboards']['playerStoryboardSpecRenderer']['spec']
|
||||
sb = player_response.get('storyboards')
|
||||
info['storyboard_spec_url'] = sb['playerStoryboardSpecRenderer']['spec'] if sb else None
|
||||
|
||||
return info
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user