Skip to content

Commit

Permalink
Make updates per comments
Browse files Browse the repository at this point in the history
Make updates per comments
  • Loading branch information
AustinGitHub committed Jan 14, 2024
1 parent 91254ce commit 1efef81
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ytmusicapi/parsers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit 1efef81

Please sign in to comment.