From 1efef81128ae89f48cdf258e368471c6b9c0b016 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 14 Jan 2024 08:10:05 -0800 Subject: [PATCH] Make updates per comments Make updates per comments --- ytmusicapi/parsers/search.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ytmusicapi/parsers/search.py b/ytmusicapi/parsers/search.py index de3dff3c..e81674d4 100644 --- a/ytmusicapi/parsers/search.py +++ b/ytmusicapi/parsers/search.py @@ -35,13 +35,8 @@ def parse_top_result(data, search_result_types): if result_type in ["song", "video", "album"]: on_tap = data.get("onTap") - if on_tap is not None: - if "watchEndpoint" in on_tap: - if nav(on_tap, WATCH_VIDEO_ID) is not None: - search_result["videoId"] = nav(on_tap, WATCH_VIDEO_ID) - if "navigationEndpoint" in on_tap: - if nav(on_tap, NAVIGATION_VIDEO_TYPE) is not None: - search_result["videoType"] = nav(on_tap, NAVIGATION_VIDEO_TYPE) + search_result["videoId"] = nav(data, ["onTap"] + WATCH_VIDEO_ID, True) + search_result["videoType"] = nav(data, ["onTap"] + NAVIGATION_VIDEO_TYPE, True) search_result["title"] = nav(data, TITLE_TEXT) runs = nav(data, ["subtitle", "runs"])