Skip to content

Commit

Permalink
Return blank album author ID when it doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
corrmaan committed Jul 10, 2024
1 parent d5653b7 commit ccc5cf9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ytmusicapi/parsers/podcasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ def from_runs(cls, description_runs: List[Dict]) -> "Description":
def parse_base_header(header: Dict) -> Dict:
"""parse common left hand side (header) items of an episode or podcast page"""
strapline = nav(header, ["straplineTextOne"])
try:
author_id = nav(strapline, ["runs", 0, *NAVIGATION_BROWSE_ID])
except KeyError:
author_id = ""
return {
"author": {
"name": nav(strapline, [*RUN_TEXT]),
"id": nav(strapline, ["runs", 0, *NAVIGATION_BROWSE_ID]),
"id": author_id,
},
"title": nav(header, TITLE_TEXT),
}
Expand Down

0 comments on commit ccc5cf9

Please sign in to comment.