Skip to content

Commit

Permalink
use 'deep_get' for storyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
zrose584 committed May 22, 2022
1 parent 75b8854 commit ea746b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions youtube/yt_data_extract/watch_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,7 @@ 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
sb = player_response.get('storyboards')
info['storyboard_spec_url'] = sb['playerStoryboardSpecRenderer']['spec'] if sb else None
info['storyboard_spec_url'] = deep_get(player_response, 'storyboards', 'playerStoryboardSpecRenderer', 'spec')

return info

Expand Down

0 comments on commit ea746b5

Please sign in to comment.