From ee0a4b9f9800d390bf0d0f8da7022cd351deec51 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, 31 Oct 2025 16:57:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BC=D0=B8=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_data.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/get_data.py b/get_data.py index e28276a..dcff8c1 100644 --- a/get_data.py +++ b/get_data.py @@ -1313,7 +1313,7 @@ async def referee(): @app.get("/team_comparison.json") async def team_comparison(): - try: + if STATUS not in ["no_game_today", "finished_today"]: data = latest_data["pregame"]["data"]["result"] teams = [] for data_team in (data["teamStats1"], data["teamStats2"]): @@ -1383,8 +1383,8 @@ async def team_comparison(): } teams.append(temp_team) return teams - except TypeError: - return {"Данных о сравнении команд нет!"} + else: + return [{"Данных о сравнении команд нет!"}] @@ -1462,7 +1462,10 @@ async def regular_standings(): @app.get("/live_status.json") async def live_status(): - return [latest_data["live-status"]["data"]["result"]] + if STATUS in ["live", "live_soon"]: + return [latest_data["live-status"]["data"]["result"]] + else: + return [{"foulsA": 0, "foulsB": 0}] if __name__ == "__main__":