diff --git a/espn_api/football/box_player.py b/espn_api/football/box_player.py index ed77f93b..09e181f4 100644 --- a/espn_api/football/box_player.py +++ b/espn_api/football/box_player.py @@ -20,9 +20,10 @@ def __init__(self, data, pro_schedule, positional_rankings, week): if player['proTeamId'] in pro_schedule: (opp_id, date) = pro_schedule[player['proTeamId']] self.game_played = 100 if datetime.now() > datetime.fromtimestamp(date/1000.0) + timedelta(hours=3) else 0 - if str(player['defaultPositionId']) in positional_rankings: + posId = str(player['defaultPositionId']) + if posId in positional_rankings: self.pro_opponent = PRO_TEAM_MAP[opp_id] - self.pro_pos_rank = positional_rankings[str(player['defaultPositionId'])][str(opp_id)] + self.pro_pos_rank = positional_rankings[posId][str(opp_id)] if str(opp_id) in positional_rankings[posId] else 0 player_stats = player['stats']