File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1039,17 +1039,19 @@ def game_highlight_data(gamePk):
1039
1039
},
1040
1040
)
1041
1041
gameHighlights = (
1042
- r ["dates" ][0 ]["games" ][0 ]["content" ]
1042
+ r ["dates" ][0 ]["games" ][0 ]
1043
+ .get ("content" , {})
1043
1044
.get ("highlights" , {})
1044
1045
.get ("highlights" , {})
1045
- .get ("items" , [])
1046
1046
)
1047
- if not len (gameHighlights ):
1047
+ if not gameHighlights or not len (gameHighlights . get ( "items" , []) ):
1048
1048
return []
1049
1049
1050
1050
unorderedHighlights = {}
1051
1051
for v in (
1052
- x for x in gameHighlights if isinstance (x , dict ) and x ["type" ] == "video"
1052
+ x
1053
+ for x in gameHighlights ["items" ]
1054
+ if isinstance (x , dict ) and x ["type" ] == "video"
1053
1055
):
1054
1056
unorderedHighlights .update ({v ["date" ]: v })
1055
1057
You can’t perform that action at this time.
0 commit comments