diff options
-rw-r--r-- | youtube/static/js/plyr-start.js | 4 | ||||
-rw-r--r-- | youtube/watch.py | 3 | ||||
-rw-r--r-- | youtube/yt_data_extract/watch_extraction.py | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/youtube/static/js/plyr-start.js b/youtube/static/js/plyr-start.js index 7b67185..6029de6 100644 --- a/youtube/static/js/plyr-start.js +++ b/youtube/static/js/plyr-start.js @@ -117,8 +117,8 @@ }, }, previewThumbnails: { - enabled: true, - src: [storyboard_url], + enabled: storyboard_url != null, + src: [storyboard_url], }, settings: ['captions', 'quality', 'speed', 'loop'], }); diff --git a/youtube/watch.py b/youtube/watch.py index a592385..886f2a4 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -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'], diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py index 309c85c..d90d9ad 100644 --- a/youtube/yt_data_extract/watch_extraction.py +++ b/youtube/yt_data_extract/watch_extraction.py @@ -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 |