Skip to content

Commit

Permalink
fix podcast episode header parsing broken due to server-side update
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Aug 24, 2024
1 parent ac7cd6b commit d6b6004
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ytmusicapi/parsers/podcasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,10 @@ def parse_podcast_header(header: dict) -> dict:

def parse_episode_header(header: dict) -> dict:
metadata = parse_base_header(header)
metadata["date"] = nav(header, [*SUBTITLE2])
metadata["duration"] = nav(header, [*SUBTITLE3], True)
if not metadata["duration"]: # progress started
progress_renderer = nav(header, ["progress", *PROGRESS_RENDERER])
metadata["duration"] = nav(progress_renderer, DURATION_TEXT, True)
metadata["progressPercentage"] = nav(progress_renderer, ["playbackProgressPercentage"])
metadata["date"] = nav(header, [*SUBTITLE])
progress_renderer = nav(header, ["progress", *PROGRESS_RENDERER])
metadata["duration"] = nav(progress_renderer, DURATION_TEXT, True)
metadata["progressPercentage"] = nav(progress_renderer, ["playbackProgressPercentage"])
metadata["saved"] = nav(header, ["buttons", 0, *TOGGLED_BUTTON], True) or False

metadata["playlistId"] = None
Expand Down

0 comments on commit d6b6004

Please sign in to comment.