This commit is contained in:
Alexey Barabanov
2025-10-20 13:33:37 +03:00
parent 55925f3847
commit e1aa4c993a
15 changed files with 22411 additions and 23816 deletions

5
.gitignore vendored
View File

@@ -1,3 +1,6 @@
.venv/*
/JSON/*
/logs/*
/logs/*
!/static/game_online.json
!/static/play_by_play.json
/static/*

View File

@@ -756,38 +756,38 @@ def Json_Team_Generation(who, data, stop_event):
player_season_stat = []
player_career_stat = []
coach_stat = []
# with ThreadPoolExecutor() as pool:
# player_season_stat_temp = [
# pool.submit(Player_Stat_Season, player_id, data["season"])
# for player_id in player_ids
# ]
# player_career_stat_temp = [
# pool.submit(Player_Stat_Career, player_id)
# for player_id in player_ids
# ]
# coach_stat_temp = [
# pool.submit(
# Coach_Stat, coach_id, data["season"], data[f"{who}_id"]
# )
# for coach_id in coach_ids
# ]
# player_futures = [pool.submit(Player_all_game, pid) for pid in player_ids]
# all_players_games = []
# for fut in as_completed(player_futures):
# try:
# all_players_games.append(fut.result())
# except Exception as e:
# logger.exception(f"Ошибка при обработке игрока: {e}")
with ThreadPoolExecutor() as pool:
player_season_stat_temp = [
pool.submit(Player_Stat_Season, player_id, data["season"])
for player_id in player_ids
]
player_career_stat_temp = [
pool.submit(Player_Stat_Career, player_id)
for player_id in player_ids
]
coach_stat_temp = [
pool.submit(
Coach_Stat, coach_id, data["season"], data[f"{who}_id"]
)
for coach_id in coach_ids
]
player_futures = [pool.submit(Player_all_game, pid) for pid in player_ids]
all_players_games = []
for fut in as_completed(player_futures):
try:
all_players_games.append(fut.result())
except Exception as e:
logger.exception(f"Ошибка при обработке игрока: {e}")
# player_season_stat += [
# res.result() for res in player_season_stat_temp
# ]
# player_career_stat += [
# res.result() for res in player_career_stat_temp
# ]
# coach_stat += [res.result() for res in coach_stat_temp]
player_season_stat += [
res.result() for res in player_season_stat_temp
]
player_career_stat += [
res.result() for res in player_career_stat_temp
]
coach_stat += [res.result() for res in coach_stat_temp]
# initialized = True
initialized = True
# print(coach_stat)
# while not stop_event.is_set():
role_list = [
@@ -2294,7 +2294,7 @@ def Play_By_Play(data: dict, stop_event: threading.Event) -> None:
json_live_status = get_json(url)
last_event = plays[-1]
if not json_live_status or json_live_status.get("message") == "Not Found":
if not json_live_status or json_live_status.get("status") == "Not Found":
period = last_event.get("period", 1)
second = 0
else:
@@ -2835,27 +2835,27 @@ def main():
args=("team1", data, stop_event),
name="Team1JSON",
),
# threading.Thread(
# target=Json_Team_Generation,
# args=("team2", data, stop_event),
# name="Team2JSON",
# ),
# threading.Thread(
# target=Team_Both_Stat, args=(stop_event,), name="BothTeamsStat"
# ),
# threading.Thread(target=Referee, args=(stop_event,), name="Referee"),
# threading.Thread(
# target=Scores_Quarter, args=(stop_event,), name="QuarterScore"
# ),
# threading.Thread(
# target=Status_Online, args=(data, stop_event), name="StatusOnline"
# ),
# threading.Thread(
# target=Play_By_Play, args=(data, stop_event), name="PlayByPlay"
# ),
# threading.Thread(
# target=Standing_func, args=(data, stop_event), name="Standings"
# ),
threading.Thread(
target=Json_Team_Generation,
args=("team2", data, stop_event),
name="Team2JSON",
),
threading.Thread(
target=Team_Both_Stat, args=(stop_event,), name="BothTeamsStat"
),
threading.Thread(target=Referee, args=(stop_event,), name="Referee"),
threading.Thread(
target=Scores_Quarter, args=(stop_event,), name="QuarterScore"
),
threading.Thread(
target=Status_Online, args=(data, stop_event), name="StatusOnline"
),
threading.Thread(
target=Play_By_Play, args=(data, stop_event), name="PlayByPlay"
),
threading.Thread(
target=Standing_func, args=(data, stop_event), name="Standings"
),
]
# Запуск всех потоков
@@ -2863,8 +2863,8 @@ def main():
t.start()
logger.debug(f"Поток {t.name} запущен.")
# How_To_Play_Quarter(data)
# pregame_data(data)
How_To_Play_Quarter(data)
pregame_data(data)
try:
while True:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,118 +2,118 @@
{
"displayNumber": "",
"positionName": "Crew chief",
"lastNameGFX": "Aleksey Davydov",
"secondName": "Mikhailovich",
"birthday": "1984-10-05T00:00:00",
"age": 41,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Referee 1",
"lastNameGFX": "Sergey Mikhailov",
"secondName": "Alexandrovich",
"birthday": "1977-05-20T00:00:00",
"age": 48,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Referee 1",
"lastNameGFX": "Andrey Sharapa",
"secondName": "",
"birthday": "1982-07-04T00:00:00",
"age": 43,
"flag": "https://flagicons.lipis.dev/flags/4x3/by.svg"
},
{
"displayNumber": "",
"positionName": "Referee 2",
"lastNameGFX": "Maksim Zhitlukhin",
"secondName": "Sergeevich",
"birthday": "1986-12-19T00:00:00",
"age": 38,
"lastNameGFX": "Roman Kladukhin",
"secondName": "Vladimirovich",
"birthday": "1990-01-09T00:00:00",
"age": 35,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Commissioner",
"lastNameGFX": "Igor Lebedev",
"secondName": "Anatolevich",
"birthday": "1965-05-27T00:00:00",
"age": 60,
"lastNameGFX": "Aleksandr Gorshkov",
"secondName": "Konstantinovich",
"birthday": "1962-06-11T00:00:00",
"age": 63,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Scorer",
"lastNameGFX": "Viktoriya Isaeva",
"secondName": "Dmitrievna",
"birthday": "1996-01-09T00:00:00",
"age": 29,
"lastNameGFX": "Lyubov Udalova",
"secondName": "Valerjevna",
"birthday": "1988-01-05T00:00:00",
"age": 37,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Assistant Scorer",
"lastNameGFX": "Dmitriy Kibenko",
"secondName": "Andreevich",
"birthday": "1983-12-25T00:00:00",
"age": 41,
"lastNameGFX": "Mariya Smolyakova",
"secondName": "Anatolevna",
"birthday": "1974-08-22T00:00:00",
"age": 51,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Timekeeper",
"lastNameGFX": "Olga Prosneva",
"secondName": "Nikolaevna",
"birthday": "1971-06-15T00:00:00",
"age": 54,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Operator 24 sec",
"lastNameGFX": "Aleksey Nagibin",
"secondName": "Vitalevich",
"birthday": "1982-08-21T00:00:00",
"age": 43,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Dictor",
"lastNameGFX": "Адель Халимов",
"secondName": "Рашидович",
"birthday": "1996-07-31T00:00:00",
"lastNameGFX": "Polina Tokareva",
"secondName": "Valerevna",
"birthday": "1996-06-20T00:00:00",
"age": 29,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Operator 24 sec",
"lastNameGFX": "Aleksandr Goverdovskiy",
"secondName": "Nikolaevich",
"birthday": "1977-03-22T00:00:00",
"age": 48,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Dictor",
"lastNameGFX": "Alexey Pereverzev",
"secondName": "Igorevich",
"birthday": "1992-06-30T00:00:00",
"age": 33,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Statistic",
"lastNameGFX": "Veronika Shuvagina",
"secondName": "Vladimirovna",
"birthday": "1968-05-08T00:00:00",
"age": 57,
"lastNameGFX": "Anton Fedyukov",
"secondName": "Aleksandrovich",
"birthday": "1979-10-02T00:00:00",
"age": 46,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Statistic",
"lastNameGFX": "Elizaveta Prudkova",
"secondName": "Sergeevna",
"birthday": "1997-05-30T00:00:00",
"age": 28,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "IS Operator",
"lastNameGFX": "Rashid Khabibullin",
"secondName": "Rinatovich",
"birthday": "1987-07-26T00:00:00",
"age": 38,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Statistic",
"lastNameGFX": "Mariya Shuvagina",
"secondName": "Dmitrievna",
"birthday": "2002-08-04T00:00:00",
"age": 23,
"lastNameGFX": "Mihail Prudkov",
"secondName": "Mihailovich",
"birthday": "1994-10-20T00:00:00",
"age": 31,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{
"displayNumber": "",
"positionName": "Video reviewer",
"lastNameGFX": "Kamil Habibullin",
"secondName": "Ildarovich",
"birthday": "1975-12-08T00:00:00",
"age": 49,
"lastNameGFX": "Yakov Tarasov",
"secondName": "Stanislavovich",
"birthday": "1992-07-21T00:00:00",
"age": 33,
"flag": "https://flagicons.lipis.dev/flags/4x3/ru.svg"
},
{

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +1,23 @@
[
{
"Q": "Q1",
"score1": "33",
"score2": "20"
"score1": "27",
"score2": "16"
},
{
"Q": "Q2",
"score1": "26",
"score2": "21"
"score1": "29",
"score2": "19"
},
{
"Q": "Q3",
"score1": "26",
"score2": "20"
"score1": "12",
"score2": "24"
},
{
"Q": "Q4",
"score1": "18",
"score2": "22"
"score2": "18"
},
{
"Q": "OT1",

View File

@@ -1,26 +1,26 @@
[
{
"team": "UNICS",
"team": "CSKA",
"winQ1": 0,
"loseQ1": 0,
"drawQ1": 0,
"scoreQ1": 0,
"score_avgQ1": null,
"winQ2": 0,
"loseQ2": 0,
"loseQ1": 2,
"drawQ1": 1,
"scoreQ1": 59,
"score_avgQ1": 19.7,
"winQ2": 1,
"loseQ2": 2,
"drawQ2": 0,
"scoreQ2": 0,
"score_avgQ2": null,
"winQ3": 0,
"scoreQ2": 50,
"score_avgQ2": 16.7,
"winQ3": 3,
"loseQ3": 0,
"drawQ3": 0,
"scoreQ3": 0,
"score_avgQ3": null,
"winQ4": 0,
"scoreQ3": 68,
"score_avgQ3": 22.7,
"winQ4": 2,
"loseQ4": 0,
"drawQ4": 0,
"scoreQ4": 0,
"score_avgQ4": null,
"drawQ4": 1,
"scoreQ4": 70,
"score_avgQ4": 23.3,
"winOT1": 0,
"loseOT1": 0,
"drawOT1": 0,
@@ -43,27 +43,27 @@
"score_avgOT4": null
},
{
"team": "BETCITY PARMA",
"winQ1": 0,
"loseQ1": 0,
"team": "Pari Nizhny Novgorod",
"winQ1": 1,
"loseQ1": 2,
"drawQ1": 0,
"scoreQ1": 0,
"score_avgQ1": null,
"winQ2": 0,
"loseQ2": 0,
"scoreQ1": 59,
"score_avgQ1": 19.7,
"winQ2": 1,
"loseQ2": 2,
"drawQ2": 0,
"scoreQ2": 0,
"score_avgQ2": null,
"winQ3": 0,
"loseQ3": 0,
"scoreQ2": 40,
"score_avgQ2": 13.3,
"winQ3": 1,
"loseQ3": 2,
"drawQ3": 0,
"scoreQ3": 0,
"score_avgQ3": null,
"winQ4": 0,
"loseQ4": 0,
"scoreQ3": 63,
"score_avgQ3": 21.0,
"winQ4": 1,
"loseQ4": 2,
"drawQ4": 0,
"scoreQ4": 0,
"score_avgQ4": null,
"scoreQ4": 55,
"score_avgQ4": 18.3,
"winOT1": 0,
"loseOT1": 0,
"drawOT1": 0,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,120 +3,120 @@
"name": "points",
"nameGFX_rus": "Очки",
"nameGFX_eng": "points",
"val1": "103",
"val2": "83"
"val1": "86",
"val2": "77"
},
{
"name": "goal2",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "28",
"val2": "25"
"val1": "20",
"val2": "17"
},
{
"name": "shot2",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "42",
"val2": "43"
"val1": "40",
"val2": "33"
},
{
"name": "goal3",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "9",
"val2": "7"
"val1": "11",
"val2": "10"
},
{
"name": "shot3",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "24",
"val2": "17"
"val1": "29",
"val2": "25"
},
{
"name": "goal1",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "20",
"val2": "12"
"val1": "13",
"val2": "13"
},
{
"name": "shot1",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "21",
"val2": "16"
"val1": "18",
"val2": "17"
},
{
"name": "assist",
"nameGFX_rus": "Передачи",
"nameGFX_eng": "assists",
"val1": "29",
"val2": "24"
"val1": "21",
"val2": "18"
},
{
"name": "pass",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "32",
"val2": "24"
"val1": "39",
"val2": "37"
},
{
"name": "steal",
"nameGFX_rus": "Перехваты",
"nameGFX_eng": "steals",
"val1": "10",
"val2": "9"
"val2": "6"
},
{
"name": "block",
"nameGFX_rus": "Блокшоты",
"nameGFX_eng": "blocks",
"val1": "3",
"val2": "0"
"val2": "3"
},
{
"name": "blocked",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "0",
"val1": "3",
"val2": "3"
},
{
"name": "defReb",
"nameGFX_rus": "подборы в защите",
"nameGFX_eng": "",
"val1": "19",
"val2": "15"
"val1": "27",
"val2": "28"
},
{
"name": "offReb",
"nameGFX_rus": "подборы в нападении",
"nameGFX_eng": "",
"val1": "14",
"val2": "8"
"val1": "11",
"val2": "5"
},
{
"name": "foulsOn",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "24",
"val2": "23"
"val1": "26",
"val2": "22"
},
{
"name": "turnover",
"nameGFX_rus": "Потери",
"nameGFX_eng": "turnovers",
"val1": "16",
"val2": "19"
"val1": "12",
"val2": "17"
},
{
"name": "foul",
"nameGFX_rus": "Фолы",
"nameGFX_eng": "fouls",
"val1": "23",
"val2": "24"
"val1": "22",
"val2": "26"
},
{
"name": "foulT",
@@ -136,14 +136,14 @@
"name": "foulC",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "0",
"val1": "2",
"val2": "0"
},
{
"name": "foulB",
"nameGFX_rus": "",
"nameGFX_eng": "",
"val1": "0",
"val1": "1",
"val2": "0"
},
{
@@ -157,140 +157,140 @@
"name": "dunk",
"nameGFX_rus": "данки",
"nameGFX_eng": "dunks",
"val1": "7",
"val2": "4"
"val1": "1",
"val2": "2"
},
{
"name": "fastBreak",
"nameGFX_rus": "",
"nameGFX_eng": "fast breaks",
"val1": "6",
"val2": "4"
"val1": "2",
"val2": "3"
},
{
"name": "plusMinus",
"nameGFX_rus": "+/-",
"nameGFX_eng": "+/-",
"val1": "100",
"val2": "-100"
"val1": "45",
"val2": "-45"
},
{
"name": "pt-1",
"nameGFX_rus": "Штрафные",
"nameGFX_eng": "free throws",
"val1": "20/21",
"val2": "12/16"
"val1": "13/18",
"val2": "13/17"
},
{
"name": "pt-2",
"nameGFX_rus": "2-очковые",
"nameGFX_eng": "2-points",
"val1": "28/42",
"val2": "25/43"
"val1": "20/40",
"val2": "17/33"
},
{
"name": "pt-3",
"nameGFX_rus": "3-очковые",
"nameGFX_eng": "3-points",
"val1": "9/24",
"val2": "7/17"
"val1": "11/29",
"val2": "10/25"
},
{
"name": "fg",
"nameGFX_rus": "очки с игры",
"nameGFX_eng": "field goals",
"val1": "37/66",
"val2": "32/60"
"val1": "31/69",
"val2": "27/58"
},
{
"name": "pt-1_pro",
"nameGFX_rus": "штрафные, процент",
"nameGFX_eng": "free throws pro",
"val1": "95%",
"val2": "75%"
"val1": "72%",
"val2": "76%"
},
{
"name": "pt-2_pro",
"nameGFX_rus": "2-очковые, процент",
"nameGFX_eng": "2-points pro",
"val1": "67%",
"val2": "58%"
"val1": "50%",
"val2": "52%"
},
{
"name": "pt-3_pro",
"nameGFX_rus": "3-очковые, процент",
"nameGFX_eng": "3-points pro",
"val1": "38%",
"val2": "41%"
"val2": "40%"
},
{
"name": "fg_pro",
"nameGFX_rus": "Очки с игры, процент",
"nameGFX_eng": "field goals pro",
"val1": "56%",
"val2": "53%"
"val1": "45%",
"val2": "47%"
},
{
"name": "Reb",
"nameGFX_rus": "Подборы",
"nameGFX_eng": "rebounds",
"val1": "33",
"val2": "23"
"val1": "38",
"val2": "33"
},
{
"name": "avgAge",
"nameGFX_rus": "",
"nameGFX_eng": "avg Age",
"val1": "26.8",
"val2": "25.4"
"val1": "30.4",
"val2": "25.0"
},
{
"name": "ptsStart",
"nameGFX_rus": "",
"nameGFX_eng": "Start PTS",
"val1": "74",
"val2": "51"
"val1": "46",
"val2": "58"
},
{
"name": "ptsStart_pro",
"nameGFX_rus": "",
"nameGFX_eng": "Start PTS, %",
"val1": "72%",
"val2": "61%"
"val1": "53%",
"val2": "75%"
},
{
"name": "ptsBench",
"nameGFX_rus": "",
"nameGFX_eng": "Bench PTS",
"val1": "29",
"val2": "32"
"val1": "40",
"val2": "19"
},
{
"name": "ptsBench_pro",
"nameGFX_rus": "",
"nameGFX_eng": "Bench PTS, %",
"val1": "28%",
"val2": "39%"
"val1": "47%",
"val2": "25%"
},
{
"name": "avgHeight",
"nameGFX_rus": "",
"nameGFX_eng": "avg height",
"val1": "198.8 cm",
"val2": "201.1 cm"
"val1": "199.2 cm",
"val2": "196.7 cm"
},
{
"name": "timeout_left",
"nameGFX_rus": "",
"nameGFX_eng": "timeout left",
"val1": "2",
"val1": "1",
"val2": "1"
},
{
"name": "timeout_str",
"nameGFX_rus": "",
"nameGFX_eng": "timeout str",
"val1": "2 Time-outs left in 2nd half",
"val1": "1 Time-out left in 2nd half",
"val2": "1 Time-out left in 2nd half"
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff