From 8f34737186b77ceda871966b8873a5d3387fea3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D1=80=D0=B8=D0=B9=20=D0=A7=D0=B5=D1=80=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Fri, 24 Oct 2025 19:09:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=B8=D0=B7=20?= =?UTF-8?q?box-score,=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=B5=20?= =?UTF-8?q?=D1=83=D1=81=D0=BF=D0=B5=D1=88=D0=BD=D0=BE=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=B1=D0=B0=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_data.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/get_data.py b/get_data.py index 1443125..412eeeb 100644 --- a/get_data.py +++ b/get_data.py @@ -354,11 +354,29 @@ def merge_online_payloads( # нормализация/дедуп # plays = _dedup_plays(plays_raw) - # print(game) + # print(game["teams"]) + # print(box_score) + for index_team, team in enumerate(game["teams"][1:]): + box_team = box_score["result"]["teams"][index_team] + for player in team.get("starts", []): + stat = next( + ( + s + for s in box_team.get("starts", []) + if s.get("startNum") == player.get("startNum") + ), + None, + ) + if stat: + player["stats"] = stat + + team["total"] = box_team.get("total", {}) + game["plays"] = play_by_play.get("result", []) game["scoreByPeriods"] = box_score["result"].get("scoreByPeriods", []) game["fullScore"] = box_score["result"].get("fullScore", {}) game["live_status"] = live_status["result"] + # game[""] merged: Dict[str, Any] = { "meta": { "generatedAt": _now_iso(),