We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de0ea50 commit 88c64beCopy full SHA for 88c64be
statsapi/__init__.py
@@ -1039,17 +1039,19 @@ def game_highlight_data(gamePk):
1039
},
1040
)
1041
gameHighlights = (
1042
- r["dates"][0]["games"][0]["content"]
+ r["dates"][0]["games"][0]
1043
+ .get("content", {})
1044
.get("highlights", {})
1045
- .get("items", [])
1046
1047
- if not len(gameHighlights):
+ if not gameHighlights or not len(gameHighlights.get("items", [])):
1048
return []
1049
1050
unorderedHighlights = {}
1051
for v in (
1052
- x for x in gameHighlights if isinstance(x, dict) and x["type"] == "video"
+ x
1053
+ for x in gameHighlights["items"]
1054
+ if isinstance(x, dict) and x["type"] == "video"
1055
):
1056
unorderedHighlights.update({v["date"]: v})
1057
0 commit comments