Skip to content

Commit

Permalink
parse_seach_result: add playlist id to album search
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbell committed May 21, 2024
1 parent 0cf0883 commit 96bf541
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ytmusicapi/parsers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ def parse_search_result(data, search_result_types, result_type, category):
if result_type in ["song", "album"]:
search_result["isExplicit"] = nav(data, BADGE_LABEL, True) is not None

if result_type in ["album"]:
search_result["playlistId"] = nav(
data,
[*PLAY_BUTTON, "playNavigationEndpoint", "watchEndpoint", "playlistId"],
True,
)

if result_type in ["episode"]:
flex_item = get_flex_column_item(data, 1)
has_date = int(len(nav(flex_item, TEXT_RUNS)) > 1)
Expand Down

0 comments on commit 96bf541

Please sign in to comment.