Skip to content

Commit

Permalink
make parse_menu_playlists more error proof
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed May 27, 2024
1 parent bd51238 commit fdc2594
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ytmusicapi/parsers/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@


def parse_menu_playlists(data, result):
watch_menu = find_objects_by_key(nav(data, MENU_ITEMS), MNIR)
menu_items = nav(data, MENU_ITEMS, True)
if menu_items is None:
return
watch_menu = find_objects_by_key(menu_items, MNIR)
for item in [_x[MNIR] for _x in watch_menu]:
icon = nav(item, ICON_TYPE)
if icon == "MUSIC_SHUFFLE":
Expand Down

0 comments on commit fdc2594

Please sign in to comment.