новый коммит
This commit is contained in:
11
get_data.py
11
get_data.py
@@ -1313,7 +1313,7 @@ async def referee():
|
|||||||
|
|
||||||
@app.get("/team_comparison.json")
|
@app.get("/team_comparison.json")
|
||||||
async def team_comparison():
|
async def team_comparison():
|
||||||
try:
|
if STATUS not in ["no_game_today", "finished_today"]:
|
||||||
data = latest_data["pregame"]["data"]["result"]
|
data = latest_data["pregame"]["data"]["result"]
|
||||||
teams = []
|
teams = []
|
||||||
for data_team in (data["teamStats1"], data["teamStats2"]):
|
for data_team in (data["teamStats1"], data["teamStats2"]):
|
||||||
@@ -1383,8 +1383,8 @@ async def team_comparison():
|
|||||||
}
|
}
|
||||||
teams.append(temp_team)
|
teams.append(temp_team)
|
||||||
return teams
|
return teams
|
||||||
except TypeError:
|
else:
|
||||||
return {"Данных о сравнении команд нет!"}
|
return [{"Данных о сравнении команд нет!"}]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1462,7 +1462,10 @@ async def regular_standings():
|
|||||||
|
|
||||||
@app.get("/live_status.json")
|
@app.get("/live_status.json")
|
||||||
async def live_status():
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user