Add check if absent
Checking if nested objects absent solved solved my issue, #298 I'm not sure if it's suitable.
This commit is contained in:
parent
527fed67ff
commit
7de7ecfcc0
1 changed files with 6 additions and 5 deletions
|
|
@ -32,6 +32,7 @@ def parse_playlist_items(results, menu_entries: List[List] = None):
|
||||||
feedback_tokens = parse_song_menu_tokens(item)
|
feedback_tokens = parse_song_menu_tokens(item)
|
||||||
|
|
||||||
# if item is not playable, the videoId was retrieved above
|
# if item is not playable, the videoId was retrieved above
|
||||||
|
if nav(data, PLAY_BUTTON, none_if_absent=True) != None:
|
||||||
if 'playNavigationEndpoint' in nav(data, PLAY_BUTTON):
|
if 'playNavigationEndpoint' in nav(data, PLAY_BUTTON):
|
||||||
videoId = nav(data,
|
videoId = nav(data,
|
||||||
PLAY_BUTTON)['playNavigationEndpoint']['watchEndpoint']['videoId']
|
PLAY_BUTTON)['playNavigationEndpoint']['watchEndpoint']['videoId']
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue