Skip to content

Commit

Permalink
add "live" property to episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Jan 23, 2024
1 parent 47b27f0 commit 18a6f20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ytmusicapi/parsers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ def parse_search_result(data, search_result_types, result_type, category):

if result_type in ["episode"]:
flex_item = get_flex_column_item(data, 1)
search_result["date"] = nav(flex_item, TEXT_RUN_TEXT)
search_result["podcast"] = parse_id_name(nav(flex_item, ["text", "runs", 2]))
has_date = int(len(nav(flex_item, TEXT_RUNS)) > 1)
search_result["live"] = bool(nav(data, ["badges", 0, "liveBadgeRenderer"], True))
if has_date:
search_result["date"] = nav(flex_item, TEXT_RUN_TEXT)

search_result["podcast"] = parse_id_name(nav(flex_item, ["text", "runs", has_date * 2]))

search_result["thumbnails"] = nav(data, THUMBNAILS, True)

Expand Down

0 comments on commit 18a6f20

Please sign in to comment.